Created
February 10, 2016 21:29
-
-
Save thornbill/4e9c761cc9c93f49a40c to your computer and use it in GitHub Desktop.
Bash function to update installed node.js versions in nvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvm_update() { | |
for NVM_UPDATE_VER in 0.10 0.12 4 5 | |
do | |
# Install the latest versions of node only if they are already installed | |
nvm which $NVM_UPDATE_VER &>/dev/null && nvm install $NVM_UPDATE_VER | |
done | |
# Switch back to the default version of node | |
echo "Switching to default version of node..." | |
nvm use default | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment