-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <>
- Loading branch information
Showing
7 changed files
with
101 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters