Allow setting path to nvm install dir.

- same behavior as the two lines the nvm install script puts in bashrc
- set NVM_DIR to path where nvm is installed
- allows for global installs in /opt or /usr/local
This commit is contained in:
Tyler Cross 2015-04-28 06:35:27 -04:00
commit 73c160fdca
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#compdef nvm
#autoload
[[ -s ~/.nvm/nvm.sh ]] || return 0
[[ -s "${NVM_DIR:=~/.nvm}" ]] || return 0
local -a _1st_arguments
_1st_arguments=(

View file

@ -1,3 +1,4 @@
# The addition 'nvm install' attempts in ~/.profile
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh
NVM_DIR="${NVM_DIR:=~/.nvm}"
[[ -s "${NVM_DIR}/nvm.sh" ]] && . "${NVM_DIR}/nvm.sh"