diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-11-30 09:23:30 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 09:23:30 +1100 |
commit | 18a63dd977ade20e17d41c08acbefde6eada8572 (patch) | |
tree | ba233cf2c4d7be978008f736f25a677d1e9dae8a /cli/tools/installer.rs | |
parent | f3b74350da69cb8cc0aedb1c1570abe2c64741ba (diff) |
feat: add `--no-check=remote` flag (#12766)
Closes #11970
Diffstat (limited to 'cli/tools/installer.rs')
-rw-r--r-- | cli/tools/installer.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 18d2d20e7..a426fea0f 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -1,4 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. + +use crate::flags::CheckFlag; use crate::flags::Flags; use crate::fs_util::canonicalize_path; use deno_core::error::generic_error; @@ -267,8 +269,12 @@ pub fn install( } } - if flags.no_check { - executable_args.push("--no-check".to_string()); + // we should avoid a default branch here to ensure we continue to cover any + // changes to this flag. + match flags.check { + CheckFlag::All => (), + CheckFlag::None => executable_args.push("--no-check".to_string()), + CheckFlag::Local => executable_args.push("--no-check=remote".to_string()), } if flags.unstable { @@ -687,7 +693,7 @@ mod tests { Flags { allow_net: Some(vec![]), allow_read: Some(vec![]), - no_check: true, + check: CheckFlag::None, log_level: Some(Level::Error), ..Flags::default() }, |