Naming `install.sh` functions more explicitly as being for `nvm`.

master
Jordan Harband 2014-07-05 13:44:00 -07:00
parent 7e269961c3
commit cce5df35ba
1 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ if ! nvm_has "curl"; then
fi fi
fi fi
install_from_git() { install_nvm_from_git() {
if [ -z "$NVM_SOURCE" ]; then if [ -z "$NVM_SOURCE" ]; then
NVM_SOURCE="https://github.com/creationix/nvm.git" NVM_SOURCE="https://github.com/creationix/nvm.git"
fi fi
@ -43,7 +43,7 @@ install_from_git() {
fi fi
} }
install_as_script() { install_nvm_as_script() {
if [ -z "$NVM_SOURCE" ]; then if [ -z "$NVM_SOURCE" ]; then
NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh" NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh"
fi fi
@ -64,9 +64,9 @@ install_as_script() {
if [ -z "$METHOD" ]; then if [ -z "$METHOD" ]; then
# Autodetect install method # Autodetect install method
if nvm_has "git"; then if nvm_has "git"; then
install_from_git install_nvm_from_git
elif nvm_has "curl"; then elif nvm_has "curl"; then
install_as_script install_nvm_as_script
else else
echo >&2 "You need git, curl, or wget to install nvm" echo >&2 "You need git, curl, or wget to install nvm"
exit 1 exit 1
@ -77,14 +77,14 @@ else
echo >&2 "You need git to install nvm" echo >&2 "You need git to install nvm"
exit 1 exit 1
fi fi
install_from_git install_nvm_from_git
fi fi
if [ "$METHOD" = "script" ]; then if [ "$METHOD" = "script" ]; then
if ! nvm_has "curl"; then if ! nvm_has "curl"; then
echo >&2 "You need curl or wget to install nvm" echo >&2 "You need curl or wget to install nvm"
exit 1 exit 1
fi fi
install_as_script install_nvm_as_script
fi fi
fi fi