Created
August 4, 2024 01:11
-
-
Save nahtnam/55ab02f1ca2f15e46a9ea772ddb7e5ce to your computer and use it in GitHub Desktop.
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
nodePackageManager() { | |
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 npm "$@" | |
fi | |
} | |
alias npm=nodePackageManager |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment