fix(installer): fall back from stale nvm dir

This commit is contained in:
Peter Steinberger
2026-04-26 07:04:39 +01:00
parent e67093f333
commit 5a89330c33
2 changed files with 4 additions and 0 deletions

View File

@@ -1415,6 +1415,9 @@ ensure_default_node_active_shell() {
load_nvm_for_node_detection() {
local nvm_dir="${NVM_DIR:-}"
if [[ -n "$nvm_dir" && ! -s "$nvm_dir/nvm.sh" ]]; then
nvm_dir=""
fi
if [[ -z "$nvm_dir" && -s "$HOME/.nvm/nvm.sh" ]]; then
nvm_dir="$HOME/.nvm"
fi

View File

@@ -93,6 +93,7 @@ describe("install.sh", () => {
].join("\n"),
{
HOME: home,
NVM_DIR: join(tmp, "stale-nvm"),
PATH: `${systemBin}:/usr/bin:/bin`,
TERM: "dumb",
},