Files
nvm/test/fast/Running 'nvm' should not change or export the caller's IFS
T
Jordan Harband 0add6b8555 [Fix] nvm: do not change or export the caller's IFS
`IFS=... nvm "$@"` is a prefix assignment to a function call, which bash's POSIX mode (macOS `/bin/sh`) keeps after the call returns, and exports.
2026-09-30 15:50:38 +09:00

20 lines
366 B
Bash
Executable File

#!/bin/sh
die () { IFS=' '; echo "$@" ; exit 1; }
: nvm.sh
\. ../../nvm.sh
IFS=':'
nvm --version >/dev/null
[ "${IFS}" = ':' ] || die "nvm changed the caller's IFS; got >${IFS}<"
set -e
nvm --version >/dev/null
set +e
[ "${IFS}" = ':' ] || die "nvm changed the caller's IFS under set -e; got >${IFS}<"
! env | grep -q '^IFS=' || die 'nvm exported IFS'
IFS=' '