Skip to content

Instantly share code, notes, and snippets.

@angelikatyborska
Last active May 30, 2022 09:35
Show Gist options
  • Save angelikatyborska/1b202a297cebcca5c64382757f44661a to your computer and use it in GitHub Desktop.
Save angelikatyborska/1b202a297cebcca5c64382757f44661a to your computer and use it in GitHub Desktop.
Prevent yourself from using the wrong js package manager
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