summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarrett Helton <jaydhelton@gmail.com>2020-08-12 14:22:06 -0400
committerGitHub <noreply@github.com>2020-08-12 14:22:06 -0400
commitde4e1fbdf0d013893516479aa6e15b15d6319e38 (patch)
treefd07bd9dbcd674222ad30007bc6b22ccb0a65204
parent18ec1290afcd78c61933ecb52e3ad97cf644f0d5 (diff)
feat: add support for --no-check flag in Deno install (#6948)
-rw-r--r--cli/flags.rs2
-rw-r--r--cli/installer.rs7
2 files changed, 8 insertions, 1 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index ce4d48dcc..6c58238de 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -362,6 +362,7 @@ fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
permission_args_parse(flags, matches);
config_arg_parse(flags, matches);
ca_file_arg_parse(flags, matches);
+ no_check_arg_parse(flags, matches);
unstable_arg_parse(flags, matches);
let root = if matches.is_present("root") {
@@ -731,6 +732,7 @@ fn install_subcommand<'a, 'b>() -> App<'a, 'b> {
.short("f")
.help("Forcefully overwrite existing installation")
.takes_value(false))
+ .arg(no_check_arg())
.arg(ca_file_arg())
.arg(unstable_arg())
.arg(config_arg())
diff --git a/cli/installer.rs b/cli/installer.rs
index f975972a3..6d498a16c 100644
--- a/cli/installer.rs
+++ b/cli/installer.rs
@@ -218,6 +218,10 @@ pub fn install(
}
}
+ if flags.no_check {
+ executable_args.push("--no-check".to_string());
+ }
+
if flags.unstable {
executable_args.push("--unstable".to_string());
}
@@ -554,6 +558,7 @@ mod tests {
Flags {
allow_net: true,
allow_read: true,
+ no_check: true,
log_level: Some(Level::Error),
..Flags::default()
},
@@ -572,7 +577,7 @@ mod tests {
assert!(file_path.exists());
let content = fs::read_to_string(file_path).unwrap();
- assert!(content.contains(r#""run" "--allow-read" "--allow-net" "--quiet" "http://localhost:4545/cli/tests/echo_server.ts" "--foobar""#));
+ assert!(content.contains(r#""run" "--allow-read" "--allow-net" "--quiet" "--no-check" "http://localhost:4545/cli/tests/echo_server.ts" "--foobar""#));
}
#[test]