From f1e7a84cb51ec41eac0e6bb7164662c66332fc34 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 14 Jul 2026 23:16:39 -0700 Subject: [PATCH] [Robustness] avoid a `set -u` error when `$_` is unset Sourcing nvm.sh under `set -u` on a POSIX shell that leaves `$_` unset (e.g. busybox ash or dash on Alpine, where the parent shell does not export it) aborted at `NVM_SCRIPT_SOURCE="$_"`. Default to empty; the only consumer already falls back to `$0`. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 3559058b..d57d0079 100755 --- a/nvm.sh +++ b/nvm.sh @@ -11,7 +11,7 @@ { # this ensures the entire script is downloaded # # shellcheck disable=SC3028 -NVM_SCRIPT_SOURCE="$_" +NVM_SCRIPT_SOURCE="${_:-}" nvm_is_zsh() { [ -n "${ZSH_VERSION-}" ]