You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --recompute flag for commands: shell and run (#2391)
## Summary
This PR continues the work from #2013 to also add the `--recompute` flag
option for `devbox run` and `devbox shell`.
For some users on bad networks, this can save them annoyance and time
for when they _know_ their devbox environment is up-to-date.
Fixes#2315
## How was it tested?
This PR affects 3 commands: `run`, `shell` and `shellenv`.
1. For `run`:
Added `"hello": "latest",` to devbox.json of this project.
```
devbox run --recompute=false -- echo "hello world"
Warning: Your devbox environment may be out of date. Run with --recompute=true to update it.
hello world
```
then
```
devbox run -- echo "hello world"
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
hello world
```
2. For `shell`. Ran similar commands as above.
3. For `shellenv`. Followed test plan of #1963.
Changed the `.envrc` to be:
```
.envrc
@@ -1,7 +1,13 @@
# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:
-eval "$(devbox generate direnv --print-envrc)"
+#eval "$(devbox generate direnv --print-envrc)"
+ # output of `devbox generate direnv --print-envrc` to modify it
+use_devbox() {
+ watch_file devbox.json devbox.lock
+ # eval "$(devbox shellenv --init-hook --install --no-refresh-alias)"
+ eval "$(devbox shellenv --init-hook --no-refresh-alias --recompute=false)"
+}
+use devbox
# check out https://www.jetify.com/devbox/docs/ide_configuration/direnv/
# for more details
```
Then modified devbox.json and saw the warning get printed.
---------
Co-authored-by: savil <>
0 commit comments