Created
November 13, 2018 12:52
-
-
Save martinratinaud/d0e1ae0e4807667cbe9dd37eab912b04 to your computer and use it in GitHub Desktop.
`npm install` or `yarn` depending on which lock file is present
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
node_i() { | |
[ -f package-lock.json ] && NPM_I=true; | |
[ -f yarn.lock ] && YARN=true; | |
if [[ $NPM_I = true && $YARN = true ]]; then | |
echo -ne "\033[0;31myou have a package-lock.json and a yarn.lock, you should pick up only one!\033[0m" | |
echo "" | |
else | |
if [ $NPM_I ]; then | |
npm i | |
fi | |
if [ $YARN ]; then | |
yarn | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment