Commit 7034939
authored
[shellenv] add --recompute flag with default=true, while keep global shellenv's recompute flag with default=false (#2013)
## 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 991c2be..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
```1 parent 309abe9 commit 7034939
3 files changed
+22
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 17 | | |
22 | | - | |
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
| |||
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | | - | |
| 79 | + | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
73 | | - | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
98 | | - | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
0 commit comments