Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add DENO_NO_PROMPT variable #14209

Merged
merged 12 commits into from
Apr 18, 2022
Next Next commit
feat: Add DENO_NO_PROMPT variable
  • Loading branch information
nayeemrmn committed Apr 5, 2022
commit dcb2c70a1567f6a18ca8dd3e60796317dde45008
5 changes: 4 additions & 1 deletion cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use deno_runtime::permissions::PermissionsOptions;
use log::debug;
use log::Level;
use once_cell::sync::Lazy;
use std::env;
nayeemrmn marked this conversation as resolved.
Show resolved Hide resolved
use std::net::SocketAddr;
use std::num::NonZeroU32;
use std::num::NonZeroU8;
Expand Down Expand Up @@ -443,6 +444,8 @@ static ENV_VARIABLES_HELP: &str = r#"ENVIRONMENT VARIABLES:
DENO_DIR Set the cache directory
DENO_INSTALL_ROOT Set deno install's output directory
(defaults to $HOME/.deno/bin)
DENO_NO_PROMPT Set to disable permission prompts on access
(alternative to passing --no-prompt on invocation)
DENO_WEBGPU_TRACE Directory to use for wgpu traces
HTTP_PROXY Proxy address for HTTP requests
(module downloads, fetch)
Expand Down Expand Up @@ -2592,7 +2595,7 @@ fn permission_args_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
flags.allow_ffi = Some(vec![]);
flags.allow_hrtime = true;
}
if matches.is_present("no-prompt") {
if env::var("DENO_NO_PROMPT").is_ok() || matches.is_present("no-prompt") {
lucacasonato marked this conversation as resolved.
Show resolved Hide resolved
flags.no_prompt = true;
}
}
Expand Down