Skip to content

Instantly share code, notes, and snippets.

@RandyMcMillan
Last active August 27, 2023 14:25
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 RandyMcMillan/4d0af1a27f58d0bf117ea0694c2b68dd to your computer and use it in GitHub Desktop.
Save RandyMcMillan/4d0af1a27f58d0bf117ea0694c2b68dd to your computer and use it in GitHub Desktop.
install nvm and .gitignore
#!/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;
@RandyMcMillan
Copy link
Author

Quietly install nvm and ignore .nvmrc .gitignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment