Merge pull request #1 from rexich/rexich/install-before-use

Install a version before use
This commit is contained in:
Filip Dimovski 2017-04-28 16:00:41 +02:00 committed by GitHub
commit d2bea48975

7
nvm.sh
View File

@ -2682,6 +2682,13 @@ nvm() {
return 127 return 127
fi fi
# Install version if not available
if ! nvm ls "$PROVIDED_VERSION" &>/dev/null; then
nvm install "$PROVIDED_VERSION"
npm install -g grunt-cli bower
return
fi
if [ "_$VERSION" = '_system' ]; then if [ "_$VERSION" = '_system' ]; then
if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then
if [ $NVM_USE_SILENT -ne 1 ]; then if [ $NVM_USE_SILENT -ne 1 ]; then