Expanding to full if statements because the shorthand results in non-zero exit codes
parent
2da44f90d2
commit
98e40a8da5
24
nvm.sh
24
nvm.sh
|
@ -1470,17 +1470,25 @@ nvm() {
|
|||
|
||||
if [ "_$VERSION" = '_system' ]; then
|
||||
if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then
|
||||
[ $silent -ne 1 ] && echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"
|
||||
fi
|
||||
return
|
||||
elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then
|
||||
[ $silent -ne 1 ] && echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"
|
||||
fi
|
||||
return
|
||||
else
|
||||
[ $silent -ne 1 ] && echo "System version of node not found." >&2
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "System version of node not found." >&2
|
||||
fi
|
||||
return 127
|
||||
fi
|
||||
elif [ "_$VERSION" = "_∞" ]; then
|
||||
[ $silent -ne 1 ] && echo "The alias \"$PROVIDED_VERSION\" leads to an infinite loop. Aborting." >&2
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "The alias \"$PROVIDED_VERSION\" leads to an infinite loop. Aborting." >&2
|
||||
fi
|
||||
return 8
|
||||
fi
|
||||
|
||||
|
@ -1517,9 +1525,13 @@ nvm() {
|
|||
command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"
|
||||
fi
|
||||
if nvm_is_iojs_version "$VERSION"; then
|
||||
[ $silent -ne 1 ] && echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"
|
||||
fi
|
||||
else
|
||||
[ $silent -ne 1 ] && echo "Now using node $VERSION$(nvm_print_npm_version)"
|
||||
if [ $silent -ne 1 ]; then
|
||||
echo "Now using node $VERSION$(nvm_print_npm_version)"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
"run" )
|
||||
|
|
Loading…
Reference in New Issue