|
|
@ -4,14 +4,19 @@ cleanup () { |
|
|
|
rm -rf "$npm_config_prefix/lib" >/dev/null 2>&1 |
|
|
|
rm -rf "$npm_config_prefix/lib" >/dev/null 2>&1 |
|
|
|
unset npm_config_prefix |
|
|
|
unset npm_config_prefix |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rm -f npm |
|
|
|
|
|
|
|
PATH="$ORIGINAL_PATH" |
|
|
|
|
|
|
|
|
|
|
|
unset -f setup cleanup die skip |
|
|
|
unset -f setup cleanup die skip |
|
|
|
unset message |
|
|
|
unset message ORIGINAL_PATH |
|
|
|
} |
|
|
|
} |
|
|
|
die () { echo $@ ; cleanup ; exit 1; } |
|
|
|
die () { echo $@ ; cleanup ; exit 1; } |
|
|
|
|
|
|
|
|
|
|
|
NVM_ENV=testing . ../../install.sh |
|
|
|
NVM_ENV=testing . ../../install.sh |
|
|
|
|
|
|
|
|
|
|
|
setup () { |
|
|
|
setup () { |
|
|
|
|
|
|
|
ORIGINAL_PATH="$PATH" |
|
|
|
|
|
|
|
|
|
|
|
npm_config_prefix="$(pwd)" |
|
|
|
npm_config_prefix="$(pwd)" |
|
|
|
export npm_config_prefix |
|
|
|
export npm_config_prefix |
|
|
|
mkdir -p "$npm_config_prefix/lib" |
|
|
|
mkdir -p "$npm_config_prefix/lib" |
|
|
@ -37,4 +42,13 @@ JSON |
|
|
|
message=$(nvm_check_global_modules) |
|
|
|
message=$(nvm_check_global_modules) |
|
|
|
[ -z "$message" ] || die "nvm_check_global_modules should have not printed a notice when npm had only itself installed as a global module" |
|
|
|
[ -z "$message" ] || die "nvm_check_global_modules should have not printed a notice when npm had only itself installed as a global module" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Faking the absence of npm |
|
|
|
|
|
|
|
PATH=".:$PATH" |
|
|
|
|
|
|
|
touch npm |
|
|
|
|
|
|
|
chmod +x npm |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message=$(nvm_check_global_modules) |
|
|
|
|
|
|
|
[ -z "$message" ] || die "nvm_check_global_modules should have not printed a notice when npm was unavailable" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cleanup |
|
|
|
cleanup |
|
|
|