Last active
August 4, 2023 18:19
-
-
Save danielbayley/62a3076902f664391b1cfbcd09d78918 to your computer and use it in GitHub Desktop.
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
#! /bin/zsh --no-rcs --err-exit | |
export PATH=node_modules/.bin:$PATH | |
alias -g i=install | |
if (($+commands[pnpm])) then | |
local p=p | |
alias pnpm=npm npx=pnpx | |
# FIXME https://github.com/pnpm/pnpm/issues/1360 | |
npm config get -g global-dir | read | |
path+=$REPLY/bin | |
fi | |
npm () { | |
case $1 in | |
env) command npx --call env;; | |
*) command ${p}npm ${@/uninstall/remove} | |
esac | |
} | |
source <(npx --shell-auto-fallback --no-install zsh) | |
[ $ZSH_EVAL_CONTEXT = toplevel ] && $0:t:r $@ |
@omar391 @dangnhdev Sorry guys, I don’t use either platform (with the exception of Windows for occasional VR gaming…) macOS only I’m afraid. Also, this Gist is farily out of date! But some equivalent of this will have a place in my ZDOTDIR
. PRs welcome if you manage to figure out improvements that don’t affect the behavior on macOS…
I use bash instead of zsh. I would like to use a bash version of this.
FYI, this broke my xcode-select
installation on macbook air m1 silicon (ventura 13.3.1)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm a Linux newbie. Can you write a simple guide to use this file please?