deno
deno copied to clipboard
`Deno.permissions.request()` prompts even if `--no-prompt` set
Calling Deno.permissions.request() will prompt the user for the permission if not already granted even when --no-prompt or NO_PROMPT is set, which seems wrong. In those cases, it should just deny un-granted permissions.
Ref: denoland/deno_emit#3 where deno_cache is using Deno.permissions.request() to ensure it has sufficient permissions to determine the DENO_DIR.
Just want to clarify what should happen if Deno.permissions.request() is called when --no-prompt is set: the promise should reject with a PermissionDenied right?
Ok I think I misunderstood, the linked PR instead just returns denied in this scenario.
Confirming this is still happening with Deno version 1.39.3. Note that this is problematic when the script is run unattended! Thanks.