Add support for `nvm install node` and `nvm install iojs`

master
Jordan Harband 2015-01-16 11:10:37 -06:00
parent 952096d034
commit ed22d3de2d
1 changed files with 17 additions and 6 deletions

23
nvm.sh
View File

@ -913,7 +913,18 @@ nvm() {
shift
fi
VERSION="$(nvm_remote_version "$provided_version")"
case "_$provided_version" in
"_$(nvm_iojs_prefix)" | "_io.js")
VERSION="$(nvm_add_iojs_prefix $(nvm_ls_remote_iojs | tail -n1))"
;;
"_$(nvm_node_prefix)")
VERSION="$(nvm_ls_remote stable)"
;;
*)
VERSION="$(nvm_remote_version "$provided_version")"
;;
esac
ADDITIONAL_PARAMETERS=''
local PROVIDED_REINSTALL_PACKAGES_FROM
local REINSTALL_PACKAGES_FROM
@ -940,6 +951,11 @@ nvm() {
return 5
fi
local NVM_IOJS
if nvm_is_iojs_version "$VERSION"; then
NVM_IOJS=true
fi
local VERSION_PATH
VERSION_PATH="$(nvm_version_path "$VERSION")"
if [ -d "$VERSION_PATH" ]; then
@ -955,11 +971,6 @@ nvm() {
return 3
fi
local NVM_IOJS
if nvm_is_iojs_version "$VERSION" || [ "_$VERSION" = "_$(nvm_iojs_prefix)" ]; then
NVM_IOJS=true
fi
if [ "_$NVM_OS" = "_freebsd" ]; then
# node.js and io.js do not have a FreeBSD binary
nobinary=1