summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/flags.rs4
-rw-r--r--cli/main.rs6
2 files changed, 6 insertions, 4 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index bc1528be1..190ddf53c 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -374,6 +374,7 @@ fn fmt_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
permission_args_parse(flags, matches);
config_arg_parse(flags, matches);
+ reload_arg_parse(flags, matches);
ca_file_arg_parse(flags, matches);
no_check_arg_parse(flags, matches);
@@ -750,6 +751,7 @@ fn install_subcommand<'a, 'b>() -> App<'a, 'b> {
.help("Forcefully overwrite existing installation")
.takes_value(false))
.arg(no_check_arg())
+ .arg(reload_arg())
.arg(ca_file_arg())
.arg(config_arg())
.about("Install script as an executable")
@@ -2473,6 +2475,7 @@ mod tests {
let r = flags_from_vec_safe(svec![
"deno",
"install",
+ "--reload",
"--allow-net",
"--allow-read",
"-n",
@@ -2489,6 +2492,7 @@ mod tests {
root: None,
force: false,
},
+ reload: true,
allow_net: true,
allow_read: true,
..Flags::default()
diff --git a/cli/main.rs b/cli/main.rs
index f45586c61..fb02e5718 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -191,12 +191,10 @@ async fn install_command(
root: Option<PathBuf>,
force: bool,
) -> Result<(), AnyError> {
- // 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 global_state = GlobalState::new(flags.clone())?;
let main_module = ModuleSpecifier::resolve_url_or_path(&module_url)?;
let mut worker = MainWorker::create(&global_state, main_module.clone())?;
+ // First, fetch and compile the module; this step ensures that the module exists.
worker.preload_module(&main_module).await?;
installer::install(flags, &module_url, args, name, root, force)
}