{bash,zsh}rc: fix pnpm aliases for corepack

This commit is contained in:
Aminda Suomalainen 2024-06-21 06:45:41 +03:00
parent 823545ed39
commit fc98187a1c
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 20 additions and 12 deletions

View File

@ -577,15 +577,19 @@ alias mkdir="\mkdir --verbose"
alias chattr="\chattr -V"
alias chmod="\chmod --verbose"
# pnpm does less duplicating around
if hash pnpm 2> /dev/null; then
alias npm=pnpm
alias npmx=pnpx
alias npx=pnpx
alias pnpmx=pnpx
# https://github.com/nodejs/corepack/blob/v0.28.2/README.md#corepack-enable--name
if hash corepack 2> /dev/null; then
alias yarn="corepack yarn"
alias yarnpkg="corepack yarnpkg"
alias pnpm="corepack pnpm"
alias pnpx="corepack pnpx"
alias npm="corepack npm"
alias npx="corepack npx"
if ! hash prettier 2> /dev/null; then
alias prettier="pnpm exec prettier --cache --ignore-unknown"
fi
else
echo "WARNING! corepack is not installed."
fi
# github-pages etc.

View File

@ -567,15 +567,19 @@ alias mkdir="\mkdir --verbose"
alias chattr="\chattr -V"
alias chmod="\chmod --verbose"
# pnpm does less duplicating around
if hash pnpm 2>/dev/null; then
alias npm=pnpm
alias npmx=pnpx
alias npx=pnpx
alias pnpmx=pnpx
# https://github.com/nodejs/corepack/blob/v0.28.2/README.md#corepack-enable--name
if hash corepack 2>/dev/null; then
alias yarn="corepack yarn"
alias yarnpkg="corepack yarnpkg"
alias pnpm="corepack pnpm"
alias pnpx="corepack pnpx"
alias npm="corepack npm"
alias npx="corepack npx"
if ! hash prettier 2>/dev/null; then
alias prettier="pnpm exec prettier --cache --ignore-unknown"
fi
else
echo "WARNING! corepack is not installed."
fi
# github-pages etc.