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_CACHED_ONLY env var as alternative to --cached-only #12769

Closed
wants to merge 9 commits into from

Conversation

ry
Copy link
Member

@ry ry commented Nov 15, 2021

Fixes #12536

@ry ry requested a review from lucacasonato November 15, 2021 17:06
cli/proc_state.rs Outdated Show resolved Hide resolved
@bnoordhuis
Copy link
Contributor

Adding one-off environment variables feels kind of meh. IMO, a better solution is a single DENO_OPTIONS="--cached-only --etc" environment variable.

@ry ry requested a review from bartlomieju as a code owner January 4, 2022 15:36
@ry ry requested review from lucacasonato and removed request for bartlomieju January 4, 2022 15:37
@bartlomieju
Copy link
Member

@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" {
Copy link
Member

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'.",
Copy link
Member

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.

@stale
Copy link

stale bot commented Mar 22, 2022

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.

@stale stale bot added the stale label Mar 22, 2022
@stale stale bot closed this Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DENO_CACHED_ONLY env var
5 participants