0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(cli/installer): Don't reload by default (#7596)

This commit is contained in:
Nayeem Rahman 2020-09-20 13:05:11 +01:00 committed by GitHub
parent db5004f200
commit 0a9d7e4e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -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()

View file

@ -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)
}