Skip to content

Commit 6c75c99

Browse files
committed
Add lazy npm function
This allows me to call `npm` even though `nvm` isn't loaded yet
1 parent e6d10d6 commit 6c75c99

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.zshrc

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
5454
# Do something under Windows NT platform
5555
fi
5656

57+
function npm() {
58+
nvm --version > /dev/null 2>&1
59+
unset -f npm
60+
npm "$@"
61+
}
62+
5763
alias ccat="pygmentize -g"
5864

5965
alias idea='nocorrect idea'

0 commit comments

Comments
 (0)