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.
16 lines
329 B
Bash
Executable File
16 lines
329 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
: nvm.sh
|
|
\. ../../nvm.sh
|
|
\. ../common.sh
|
|
|
|
make_fake_node v0.0.1
|
|
sudo touch ""$(nvm_version_path v0.0.1)"/sudo"
|
|
|
|
RETURN_MESSAGE="$(nvm uninstall v0.0.1 2>&1 || echo)"
|
|
CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder"
|
|
|
|
[ "${RETURN_MESSAGE#*$CHECK_FOR}" != "$RETURN_MESSAGE" ] || exit 1
|