Skip to content

Instantly share code, notes, and snippets.

@raisiqueira
Created February 18, 2022 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raisiqueira/8798912ec6ae88f70115ec880dfec8be to your computer and use it in GitHub Desktop.
Save raisiqueira/8798912ec6ae88f70115ec880dfec8be to your computer and use it in GitHub Desktop.
Script to install a NodeJS version from a .nvmrc file
#!/bin/sh
NODE_VER="$(cat .nvmrc)"
if [[ -f "${HOME}/.nvm/nvm.sh" ]]; then
# Normal *nix
source "${HOME}/.nvm/nvm.sh"
fi
nvm install "$NODE_VER"
nvm use "$NODE_VER"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment