mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-04 17:02:48 +08:00
nvm.sh uses `NVM_SCRIPT_SOURCE="$_"` to detect its source location. Adding `: nvm.sh` before each source line ensures `$_` is set correctly, preventing breakage when the previous command (e.g., `set -ex`) overwrites it.
29 lines
384 B
Bash
Executable File
29 lines
384 B
Bash
Executable File
#!/bin/sh
|
|
|
|
cleanup () {
|
|
rm -rf "${NVM_DIR}/versions/io.js/v0.1.2"
|
|
}
|
|
die () { echo "$@" ; exit 1; }
|
|
|
|
: nvm.sh
|
|
\. ../../../nvm.sh
|
|
\. ../../common.sh
|
|
|
|
make_fake_iojs v0.1.2
|
|
|
|
nvm use iojs-v0.1.2
|
|
|
|
if command -v iojs; then
|
|
nvm_has_system_iojs
|
|
else
|
|
! nvm_has_system_iojs
|
|
fi
|
|
|
|
nvm deactivate /dev/null 2>&1
|
|
|
|
if command -v iojs; then
|
|
nvm_has_system_iojs
|
|
else
|
|
! nvm_has_system_iojs
|
|
fi
|