Skip to content

Commit 11fba11

Browse files
authored
Persist devbox binary version in shell session if version is pinned (#459)
## Summary TLDR; Persist devbox binary version in shell session if version is pinned, by whitelisting `DEVBOX_USE_VERSION` as an env variable to keep in devbox shell. Currently, if a user pin a devbox version to use via `DEVBOX_USE_VERSION=0.1.2 devbox shell`, inside the shell, any devbox command will use the latest version instead of the pinned `0.1.2` version. This change makes sure that the devbox version inside a devbox shell is the same as the one outside, if pinned. ## How was it tested? `DEVBOX_USE_VERSION=0.1.2 devbox shell` in devbox shell `devbox version` -> it should output `0.1.2` instead of `0.2.0`
1 parent 4886e1f commit 11fba11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/nix/shell.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ var envToKeep = map[string]bool{
511511
"NIX_SSL_CERT_FILE": true, // The path to Nix-installed SSL certificates (used by some Nix programs).
512512
"SSL_CERT_FILE": true, // The path to non-Nix SSL certificates (used by some Nix and non-Nix programs).
513513
"NIXPKGS_ALLOW_UNFREE": true, // Whether to allow the use of unfree packages.
514+
515+
// Devbox
516+
//
517+
// Variables specific to devbox configuration.
518+
"DEVBOX_USE_VERSION": true, // Version of devbox used upon invoking `devbox shell`.
514519
}
515520

516521
func buildAllowList(allowList []string) map[string]bool {

0 commit comments

Comments
 (0)