Created
January 9, 2022 16:53
-
-
Save joeworkman/373c8b72e5596aaa6094e8e1bc97845c to your computer and use it in GitHub Desktop.
Store a set of folders that will run pnpm instead of npm without having to remember what repos use what command. This is a simple shell function that you can add to your shell rc file.
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() { | |
pnpm_folders=(/dev/repo1 /dev/repo2) | |
if printf '%s\n' "${pnpm_folders[@]}" | grep `pwd` ; then | |
pnpm $@ | |
else | |
npm $@ | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment