Last active
August 27, 2023 14:25
-
-
Save RandyMcMillan/4d0af1a27f58d0bf117ea0694c2b68dd to your computer and use it in GitHub Desktop.
install nvm and .gitignore
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
#!/usr/bin/env bash | |
(echo `pwd`) & clear && \ | |
NVM_VERSION=v16.20.2 | |
touch .nvmrc | |
echo $NVM_VERSION > .nvmrc | |
if ! grep -q "$NVM_VERSION" .nvmrc; then echo "$NVM_VERSION" > .nvmrc; fi;\ | |
touch .gitignore | |
if ! grep -q ".nvmrc" .gitignore; then echo ".nvmrc" >> .gitignore; fi;\ | |
if ! grep -q ".gitignore" .gitignore; then echo ".gitignore" >> .gitignore; fi;\ | |
export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] >/tmp/install-nvm.log && \. "$NVM_DIR/nvm.sh" >/tmp/install-nvm.log && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && echo "install-nvm:node -v $NVM_VERSION" && nvm install $NVM_VERSION >/tmp/install-nvm.log 2>&1 && nvm use --silent 2>/tmp/install-nvm.log; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quietly install nvm and ignore .nvmrc .gitignore