diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-08-20 04:20:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 01:20:06 +0000 |
commit | 4f49f703c10afcde7155baac2b494fa6670c0115 (patch) | |
tree | ad9231735e1fc57a71e77de97dc0ac20ea9705a6 /runtime/permissions/prompter.rs | |
parent | 0eba180fdbfdc19e15c743f00382d3fc79f65a10 (diff) |
fix(cli): update permission prompt message for compiled binaries (#24081)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'runtime/permissions/prompter.rs')
-rw-r--r-- | runtime/permissions/prompter.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs index 050902d59..e48e0af10 100644 --- a/runtime/permissions/prompter.rs +++ b/runtime/permissions/prompter.rs @@ -11,6 +11,8 @@ use std::io::StderrLock; use std::io::StdinLock; use std::io::Write as IoWrite; +use crate::is_standalone; + /// Helper function to make control characters visible so users can see the underlying filename. fn escape_control_characters(s: &str) -> std::borrow::Cow<str> { if !s.contains(|c: char| c.is_ascii_control() || c.is_control()) { @@ -339,7 +341,11 @@ impl PermissionPrompter for TtyPrompter { )) ); writeln!(&mut output, "┠─ {}", colors::italic(&msg)).unwrap(); - let msg = format!("Run again with --allow-{name} to bypass this prompt."); + let msg = if is_standalone() { + format!("Specify the required permissions during compile time using `deno compile --allow-{name}`.") + } else { + format!("Run again with --allow-{name} to bypass this prompt.") + }; writeln!(&mut output, "┠─ {}", colors::italic(&msg)).unwrap(); write!(&mut output, "┗ {}", colors::bold("Allow?")).unwrap(); write!(&mut output, " {opts} > ").unwrap(); |