When none of the directories exist, don't `find` within them.
parent
12ca8f2607
commit
cd481ff548
2
nvm.sh
2
nvm.sh
|
@ -557,6 +557,7 @@ nvm_ls() {
|
||||||
if [ -z "$PATTERN" ]; then
|
if [ -z "$PATTERN" ]; then
|
||||||
PATTERN='v'
|
PATTERN='v'
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$NVM_DIRS_TO_SEARCH" ]; then
|
||||||
VERSIONS="$(command find $NVM_DIRS_TO_SEARCH -maxdepth 1 -type d -name "$PATTERN*" \
|
VERSIONS="$(command find $NVM_DIRS_TO_SEARCH -maxdepth 1 -type d -name "$PATTERN*" \
|
||||||
| command sed "s#$NVM_VERSION_DIR_IOJS/#"$NVM_IOJS_PREFIX"-#" \
|
| command sed "s#$NVM_VERSION_DIR_IOJS/#"$NVM_IOJS_PREFIX"-#" \
|
||||||
| command grep -v "$NVM_VERSION_DIR_IOJS" \
|
| command grep -v "$NVM_VERSION_DIR_IOJS" \
|
||||||
|
@ -569,6 +570,7 @@ nvm_ls() {
|
||||||
| command sort -s -t- -k1.1,1.1 \
|
| command sort -s -t- -k1.1,1.1 \
|
||||||
| command sed "s/^\($NVM_IOJS_PREFIX\)\./\1-/" \
|
| command sed "s/^\($NVM_IOJS_PREFIX\)\./\1-/" \
|
||||||
| command sed "s/^$NVM_NODE_PREFIX\.//")"
|
| command sed "s/^$NVM_NODE_PREFIX\.//")"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
|
|
Loading…
Reference in New Issue