mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
feat: add support for --no-check flag in Deno install (#6948)
This commit is contained in:
parent
18ec1290af
commit
de4e1fbdf0
2 changed files with 8 additions and 1 deletions
|
@ -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())
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue