feat(nvm): add npx to lazy trigger list

Closes #11740
This commit is contained in:
Carlo Sala 2023-06-07 18:43:47 +02:00
parent 115cee1701
commit 46c70406dd
No known key found for this signature in database
GPG Key ID: DA6FB450C1A4FE9A
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced:
#### Lazy startup #### Lazy startup
This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source
nvm script only when using it, and will create a function for `node`, `npm`, `pnpm`, `yarn`, and the nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, and the
command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with
default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced: default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:

View File

@ -43,8 +43,8 @@ if zstyle -t ':omz:plugins:nvm' lazy; then
# Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd
zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd
eval " eval "
function nvm node npm pnpm yarn $nvm_lazy_cmd { function nvm node npm npx pnpm yarn $nvm_lazy_cmd {
unfunction nvm node npm pnpm yarn $nvm_lazy_cmd unfunction nvm node npm npx pnpm yarn $nvm_lazy_cmd
# Load nvm if it exists in \$NVM_DIR # Load nvm if it exists in \$NVM_DIR
[[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\" [[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\"
\"\$0\" \"\$@\" \"\$0\" \"\$@\"