dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
1.02k stars 34 forks source link

feat: allow user to --deny-env #181

Closed leighmcculloch closed 2 months ago

leighmcculloch commented 1 year ago

What

Allow the user to deny dax from accessing the env, by checking if env has been denied before attempting to read from the env.

Why

It's not always necessary for scripts to access the env and dax is exposed to the env unnecessarily. Dax currently doesn't provide a way to turn the need for env off.

Note that if --deny-env is not passed, and the env has not been allowed, then this change will still cause the prompt to appear. The only situation this change impacts is when a script has explicitly denied access to the env.