From fc98187a1cf404daf7bfcb3872cdb00fd02cb477 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 21 Jun 2024 06:45:41 +0300 Subject: [PATCH] {bash,zsh}rc: fix pnpm aliases for corepack --- rc/bashrc | 16 ++++++++++------ rc/zshrc | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/rc/bashrc b/rc/bashrc index 612a648a..ff641e9a 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -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. diff --git a/rc/zshrc b/rc/zshrc index 74e32520..4010df6f 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -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.