Skip to content

Instantly share code, notes, and snippets.

@bardic
Created January 20, 2019 14:20
Show Gist options
  • Select an option

  • Save bardic/e71e421aba290ee766634a9ac0baf17f to your computer and use it in GitHub Desktop.

Select an option

Save bardic/e71e421aba290ee766634a9ac0baf17f to your computer and use it in GitHub Desktop.
npm_new() {
if [ "$1" != "" ]
then
mkdir "$1"
cd "$1"
if ! type nvm > /dev/null; then
echo "Insatll NVM. I'm not doing it for you since you need shell integration"
echo "https://github.com/creationix/nvm"
return 1
fi
if ! type node > /dev/null; then
echo "How the hell did you make it here? NVM should install a version of node."
return 1
fi
node -v > .nvmrc
npm init -y
if ! type gitignore > /dev/null; then
npm install gitignore -g
fi
gitignore Node
else
echo "You did it wrong. Do it better"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment