Browse Source

silent `which nvm` error in lazy load

GNU `which` prints an error to stderr when a binary is not found, that
is displayed with every new terminal startup when zsh-nvm is in lazy
load mode:

`/usr/local/bin/gwhich: no nvm in (...)`

This patch redirects `which` errors to `/dev/null` while keeping stdout output
available.
pull/36/head
Aitor Guevara 8 years ago
committed by GitHub
parent
commit
094a9a6e28
  1. 2
      zsh-nvm.plugin.zsh

2
zsh-nvm.plugin.zsh

@ -92,7 +92,7 @@ _zsh_nvm_lazy_load() {
local cmds local cmds
cmds=() cmds=()
for bin in $global_binaries; do for bin in $global_binaries; do
[[ "$(which $bin)" = "$bin: aliased to "* ]] || cmds+=($bin) [[ "$(which $bin 2> /dev/null)" = "$bin: aliased to "* ]] || cmds+=($bin)
done done
# Create function for each command # Create function for each command

Loading…
Cancel
Save