summaryrefslogtreecommitdiff
path: root/ext/fs
diff options
context:
space:
mode:
authorYazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps>2024-08-20 04:20:06 +0300
committerGitHub <noreply@github.com>2024-08-20 01:20:06 +0000
commit4f49f703c10afcde7155baac2b494fa6670c0115 (patch)
treead9231735e1fc57a71e77de97dc0ac20ea9705a6 /ext/fs
parent0eba180fdbfdc19e15c743f00382d3fc79f65a10 (diff)
fix(cli): update permission prompt message for compiled binaries (#24081)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'ext/fs')
-rw-r--r--ext/fs/ops.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs
index 57b0e0b9e..e8a074be5 100644
--- a/ext/fs/ops.rs
+++ b/ext/fs/ops.rs
@@ -67,7 +67,14 @@ fn map_permission_error(
} else {
(path.as_str(), "")
};
- custom_error("PermissionDenied", format!("Requires {err} access to {path}{truncated}, run again with the --allow-{err} flag"))
+ let msg = if deno_permissions::is_standalone() {
+ format!(
+ "Requires {err} access to {path}{truncated}, specify the required permissions during compilation using `deno compile --allow-{err}`")
+ } else {
+ format!(
+ "Requires {err} access to {path}{truncated}, run again with the --allow-{err} flag")
+ };
+ custom_error("PermissionDenied", msg)
}
err => Err::<(), _>(err)
.context_path(operation, path)