0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 12:16:11 -05:00
denoland-deno/tests/testdata/npm/compile_npm_no_permissions.out
Marvin Hagemeister 4e655e543f
feat: Deno.cwd() no longer requires --allow-read permission (#27192)
This commit changes "Deno.cwd()" (as well as "process.cwd()") to no
longer require full "--allow-read" permission. This change was meant to be done
in Deno 2.0.0, but somehow it slipped. Requiring full read permission
just to read the CWD is a mistake, because CWD can already be obtained
with no permission by throwing an error in JS and inspecting its stack.

Fixes https://github.com/denoland/deno/issues/27110

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-27 15:13:59 +01:00

5 lines
275 B
Text

Hello in CLI with permissions
Reading DENO_HELLO env var...
error: Uncaught (in promise) NotCapable: Requires env access to "DENO_HELLO", specify the required permissions during compilation using `deno compile --allow-env`
console.log(Deno.env.get("DENO_HELLO"));
[WILDCARD]