mirror of
https://github.com/denoland/deno.git
synced 2024-12-26 00:59:24 -05:00
Switch grant/deny prompt to yes/no (#10547)
This commit is contained in:
parent
dfe528198d
commit
18c75f0e42
2 changed files with 7 additions and 7 deletions
|
@ -2902,7 +2902,7 @@ console.log("finish");
|
|||
fn _061_permissions_request() {
|
||||
let args = "run 061_permissions_request.ts";
|
||||
let output = "061_permissions_request.ts.out";
|
||||
let input = b"g\nd\n";
|
||||
let input = b"y\nn\n";
|
||||
|
||||
util::test_pty(args, output, input);
|
||||
}
|
||||
|
@ -2912,7 +2912,7 @@ console.log("finish");
|
|||
fn _062_permissions_request_global() {
|
||||
let args = "run 062_permissions_request_global.ts";
|
||||
let output = "062_permissions_request_global.ts.out";
|
||||
let input = b"g\n";
|
||||
let input = b"y\n";
|
||||
|
||||
util::test_pty(args, output, input);
|
||||
}
|
||||
|
@ -3077,7 +3077,7 @@ console.log("finish");
|
|||
fn _090_run_permissions_request() {
|
||||
let args = "run 090_run_permissions_request.ts";
|
||||
let output = "090_run_permissions_request.ts.out";
|
||||
let input = b"g\nd\n";
|
||||
let input = b"y\nn\n";
|
||||
|
||||
util::test_pty(args, output, input);
|
||||
}
|
||||
|
|
|
@ -1054,9 +1054,9 @@ fn permission_prompt(message: &str) -> bool {
|
|||
if !atty::is(atty::Stream::Stdin) || !atty::is(atty::Stream::Stderr) {
|
||||
return false;
|
||||
};
|
||||
let opts = "[g/d (g = grant, d = deny)] ";
|
||||
let opts = "[y/n (y = yes allow, n = no deny)] ";
|
||||
let msg = format!(
|
||||
"{} ️Deno requests {}. Grant? {}",
|
||||
"{} ️Deno requests {}. Allow? {}",
|
||||
PERMISSION_EMOJI, message, opts
|
||||
);
|
||||
// print to stderr so that if deno is > to a file this is still displayed.
|
||||
|
@ -1073,8 +1073,8 @@ fn permission_prompt(message: &str) -> bool {
|
|||
Some(v) => v,
|
||||
};
|
||||
match ch.to_ascii_lowercase() {
|
||||
'g' => return true,
|
||||
'd' => return false,
|
||||
'y' => return true,
|
||||
'n' => return false,
|
||||
_ => {
|
||||
// If we don't get a recognized option try again.
|
||||
let msg_again = format!("Unrecognized option '{}' {}", ch, opts);
|
||||
|
|
Loading…
Reference in a new issue