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:
parent
db5004f200
commit
0a9d7e4e39
2 changed files with 6 additions and 4 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue