Last active
May 30, 2022 09:35
-
-
Save angelikatyborska/1b202a297cebcca5c64382757f44661a to your computer and use it in GitHub Desktop.
Prevent yourself from using the wrong js package manager
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
npm() { | |
if [ -f yarn.lock ]; then | |
echo 'use yarn'; | |
else | |
command npm $*; | |
fi | |
} | |
yarn() { | |
if [ -f package-lock.json ]; then | |
echo 'use npm'; | |
else | |
command yarn $*; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment