Use `case` instead of multiple if/else statement.
parent
9e09c30621
commit
07bb79f405
17
nvm.sh
17
nvm.sh
|
@ -1943,19 +1943,24 @@ nvm() {
|
||||||
if [ -z "${NVM_MAKE_JOBS-}" ]; then
|
if [ -z "${NVM_MAKE_JOBS-}" ]; then
|
||||||
nvm_get_make_jobs
|
nvm_get_make_jobs
|
||||||
fi
|
fi
|
||||||
if [ "$NVM_IOJS" != true ] && [ "$NVM_NODE_MERGED" != true ]; then
|
|
||||||
if nvm_install_node_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"; then
|
case "true" in
|
||||||
NVM_INSTALL_SUCCESS=true
|
"$NVM_IOJS")
|
||||||
fi
|
|
||||||
elif [ "$NVM_IOJS" = true ]; then
|
|
||||||
# nvm_install_iojs_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"
|
# nvm_install_iojs_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"
|
||||||
nvm_err 'Installing iojs from source is not currently supported'
|
nvm_err 'Installing iojs from source is not currently supported'
|
||||||
return 105
|
return 105
|
||||||
elif [ "$NVM_NODE_MERGED" = true ]; then
|
;;
|
||||||
|
"$NVM_NODE_MERGED")
|
||||||
# nvm_install_merged_node_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"
|
# nvm_install_merged_node_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"
|
||||||
nvm_err 'Installing node v1.0 and greater from source is not currently supported'
|
nvm_err 'Installing node v1.0 and greater from source is not currently supported'
|
||||||
return 106
|
return 106
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if nvm_install_node_source "$VERSION" "$NVM_MAKE_JOBS" "$ADDITIONAL_PARAMETERS"; then
|
||||||
|
NVM_INSTALL_SUCCESS=true
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$NVM_INSTALL_SUCCESS" = true ] && nvm use "$VERSION"; then
|
if [ "$NVM_INSTALL_SUCCESS" = true ] && nvm use "$VERSION"; then
|
||||||
|
|
Loading…
Reference in New Issue