Skip to content

UI/UX ~ avoid Deno permissions prompt when importing module #2216

@rivy

Description

@rivy

As currently written (in v17.5.1), the deno platform shim will unavoidably prompt the user for 'env' and 'read' permissions if not already granted when the module is imported.

image

No matter which answers are given, the module is imported without error.

But this is a forced UI/UX interaction that the most user scripts would want to avoid, instead giving user feedback in accordance to the script's own UI/UX plan. This could be especially problematic for CI where there is no user at the keyboard to answer.

A small change to the use of permission queries instead of using try/catch can fix this behavior while keeping the fallback values in place for the cwd and env variables (see PR #2217).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions