jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
7.94k stars 191 forks source link

[shellenv] add --recompute flag with default=true, while keep global shellenv's recompute flag with default=false #2013

Closed savil closed 2 months ago

savil commented 2 months ago

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?

% git diff
diff --git a/internal/boxcli/shellenv.go b/internal/boxcli/shellenv.go
index 991c2bec..8076e125 100644
--- a/internal/boxcli/shellenv.go
+++ b/internal/boxcli/shellenv.go
@@ -78,6 +78,9 @@ func shellEnvFunc(
        cmd *cobra.Command,
        flags shellEnvCmdFlags,
 ) (string, error) {
+       fmt.Printf("shellenv --recompute flag is %v\n", flags.recompute)
+       return "", nil
+
        env, err := flags.Env(flags.config.path)
        if err != nil {
                return "", err

compiled via devbox run build, and then:

 % devbox shellenv
shellenv --recompute flag is true

hash -r
 % devbox global shellenv
shellenv --recompute flag is false

hash -r
savil commented 2 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @savil and the rest of your teammates on Graphite Graphite

savil commented 2 months ago

@mikeland73 @gcurtis ping

sentry-io[bot] commented 2 months ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎