8c5f64cc2f0e75399a1e906e39713ed25b65ece1

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

feat(nvm): add `corepack` to `lazy_cmd`

Diff

 1diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md
 2index e88ce0158bbf748edaa681557b70296f274e7db5..eb1e236ee65395250e4d37820e90d72bcf9b3cd5 100644
 3--- a/plugins/nvm/README.md
 4+++ b/plugins/nvm/README.md
 5@@ -26,9 +26,9 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced:
 6 #### Lazy startup
 7 
 8 This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source
 9-nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, and the
10-command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with
11-default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:
12+nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, `corepack`
13+and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run
14+with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:
15 
16 ```zsh
17 zstyle ':omz:plugins:nvm' lazy yes
18diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh
19index c2e8de94b5affa6ded43dc94ea6bba64680f5a4f..95c94030a833c2d736745efa8523f8e282f5308f 100644
20--- a/plugins/nvm/nvm.plugin.zsh
21+++ b/plugins/nvm/nvm.plugin.zsh
22@@ -72,9 +72,9 @@ function _omz_setup_autoload {
23 }
24 
25 if zstyle -t ':omz:plugins:nvm' lazy; then
26-  # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd
27+  # Call nvm when first using nvm, node, npm, pnpm, yarn, corepack or other commands in lazy-cmd
28   zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd
29-  nvm_lazy_cmd=(nvm node npm npx pnpm yarn $nvm_lazy_cmd) # default values
30+  nvm_lazy_cmd=(nvm node npm npx pnpm yarn corepack $nvm_lazy_cmd) # default values
31   eval "
32     function $nvm_lazy_cmd {
33       for func in $nvm_lazy_cmd; do