Created
January 20, 2019 14:20
-
-
Save bardic/e71e421aba290ee766634a9ac0baf17f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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