-
Notifications
You must be signed in to change notification settings - Fork 195
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
[shellenv] add --recompute flag with default=true, while keep global shellenv's recompute flag with default=false #2013
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
70aed6b
to
98f81bb
Compare
…shellenv's recompute flag with default=false
98f81bb
to
82e3259
Compare
@mikeland73 @gcurtis ping |
internal/boxcli/global.go
Outdated
shellEnv := shellEnvCmd() | ||
// For `devbox shellenv` the default value of recompute is true. | ||
// Change the default value to false for `devbox global shellenv` only. | ||
shellEnv.Flag("recompute").DefValue = "false" |
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.
I don't think this is strictly needed , only for internal consistency. maybe add a comment?
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.
The DefValue
modifies the default value printed in the --help
. Without this line, the help for the flag looks like:
% devbox global shellenv --help
...
-r, --recompute Recompute environment if needed (default true)
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.
Added comment to explain this need.
internal/boxcli/global.go
Outdated
if err := shellEnv.Flag("recompute").Value.Set("false"); err != nil { | ||
panic(errors.WithStack(err)) | ||
} |
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.
Maybe add comment:
// This will never panic because internally it just does `strconv.ParseBool("false")` which is always valid
deb89e3
to
91722d8
Compare
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Summary
Credit to @dax and #1963 for pointing out the need for this, and pioneering this solution.
This PR merely nudges the code to be a bit neater.
How was it tested?
compiled via
devbox run build
, and then: