summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-09-16 17:56:06 +0200
committerBert Belder <bertbelder@gmail.com>2020-09-16 18:41:58 +0200
commit21f2e45b0d4932bb1f2db31171b6a4d1b4e7f35e (patch)
tree10e517ba7132c4ad31598dff48f0b549470d8b0f /cli/main.rs
parentf58b10ec646533bb573e9fcc61160e31cb21ae05 (diff)
Revert "feat(install): bundle before installation" (#7522)
This reverts the changes introduced by PR #5276, which made `deno install «script»` automatically bundle the script's dependencies. It broke the `deno install` command for a large number of scripts. This reverts commit 34e98fa59cd70f7ce64e587bef41fac536a3076b. Closes: #7492
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/main.rs b/cli/main.rs
index d121d1c92..64c73664c 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -201,7 +201,14 @@ async fn install_command(
root: Option<PathBuf>,
force: bool,
) -> Result<(), AnyError> {
- installer::install(flags, &module_url, args, name, root, force).await
+ // First, fetch and compile the module; this step ensures that the module exists.
+ let mut fetch_flags = flags.clone();
+ fetch_flags.reload = true;
+ let global_state = GlobalState::new(fetch_flags)?;
+ let main_module = ModuleSpecifier::resolve_url_or_path(&module_url)?;
+ let mut worker = MainWorker::create(&global_state, main_module.clone())?;
+ worker.preload_module(&main_module).await?;
+ installer::install(flags, &module_url, args, name, root, force)
}
async fn lint_command(