Created
November 22, 2023 17:08
-
-
Save jbouhier/d119647ee3dda0be6a54f9cb56e71bfb to your computer and use it in GitHub Desktop.
JS pacakge manager CLI shorthand
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
# Automatically uses the package manager of current directory | |
# Just type "start" or any other scripts fo your package.json file | |
p() { | |
if [[ -f bun.lockb ]]; then | |
command bun "$@" | |
elif [[ -f pnpm-lock.yaml ]]; then | |
command pnpm "$@" | |
elif [[ -f yarn.lock ]]; then | |
command yarn "$@" | |
elif [[ -f package-lock.json ]]; then | |
command npm "$@" | |
else | |
command pnpm "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment