0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 20:25:12 -05:00

feat: add support for --no-check flag in Deno install (#6948)

This commit is contained in:
Jarrett Helton 2020-08-12 14:22:06 -04:00 committed by GitHub
parent 18ec1290af
commit de4e1fbdf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -362,6 +362,7 @@ fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
permission_args_parse(flags, matches); permission_args_parse(flags, matches);
config_arg_parse(flags, matches); config_arg_parse(flags, matches);
ca_file_arg_parse(flags, matches); ca_file_arg_parse(flags, matches);
no_check_arg_parse(flags, matches);
unstable_arg_parse(flags, matches); unstable_arg_parse(flags, matches);
let root = if matches.is_present("root") { let root = if matches.is_present("root") {
@ -731,6 +732,7 @@ fn install_subcommand<'a, 'b>() -> App<'a, 'b> {
.short("f") .short("f")
.help("Forcefully overwrite existing installation") .help("Forcefully overwrite existing installation")
.takes_value(false)) .takes_value(false))
.arg(no_check_arg())
.arg(ca_file_arg()) .arg(ca_file_arg())
.arg(unstable_arg()) .arg(unstable_arg())
.arg(config_arg()) .arg(config_arg())

View file

@ -218,6 +218,10 @@ pub fn install(
} }
} }
if flags.no_check {
executable_args.push("--no-check".to_string());
}
if flags.unstable { if flags.unstable {
executable_args.push("--unstable".to_string()); executable_args.push("--unstable".to_string());
} }
@ -554,6 +558,7 @@ mod tests {
Flags { Flags {
allow_net: true, allow_net: true,
allow_read: true, allow_read: true,
no_check: true,
log_level: Some(Level::Error), log_level: Some(Level::Error),
..Flags::default() ..Flags::default()
}, },
@ -572,7 +577,7 @@ mod tests {
assert!(file_path.exists()); assert!(file_path.exists());
let content = fs::read_to_string(file_path).unwrap(); 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] #[test]