Skip to content

Instantly share code, notes, and snippets.

@beenotung
Created June 24, 2021 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beenotung/c8b0a0b2ef9ef7cdda2ba383a5654f78 to your computer and use it in GitHub Desktop.
Save beenotung/c8b0a0b2ef9ef7cdda2ba383a5654f78 to your computer and use it in GitHub Desktop.
proxy yarn to call pnpm
#!/bin/bash
set -e
set -o pipefail
echo >&2 original: yarn $@
if [ "$1" == 'install' ] || [ "$1" == 'add' ] ; then
shift
if [ "$1" == '--silent' ]; then
shift
fi
echo >&2 mapto: pnpm install --prefer-offline $@
pnpm install --prefer-offline $@
else
echo >&2 mapto: npm run $@
npm run $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment