Created
April 5, 2022 05:54
-
-
Save SamJakob/f330484630818e8b2190bd9415575294 to your computer and use it in GitHub Desktop.
zsh script to check if in an npm directory when trying to run yarn
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
# ... | |
# Ensure yarn is not run in an npm directory. | |
yarn() { | |
if [ -f "./package-lock.json" ]; then | |
echo "no... this is an npm directory" | |
else | |
command yarn $@ | |
fi | |
} | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment