-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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_CACHED_ONLY env var as alternative to --cached-only #12769
Conversation
Adding one-off environment variables feels kind of meh. IMO, a better solution is a single |
@ry is this something you want to land? What about other flags that could potentially benefit from having an env var mimic? |
|
||
fn binary_env_var(name: &str) -> bool { | ||
if let Ok(v) = env::var(name) { | ||
if v == "1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know my position on this, we should accept "true" and "false" for consistency.
This also works with NO_COLOR
(evidence).
false | ||
} else { | ||
eprintln!( | ||
"env var '{}' has a bad value '{}'. Use '1' or '0'.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for showing feedback when the env var has an unsupported value.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Fixes #12536