Ensure that `nvm ls node` doesn't return "node_modules", for example.
parent
1d37af162a
commit
6dc602b521
2
nvm.sh
2
nvm.sh
|
@ -196,7 +196,7 @@ nvm_ls() {
|
||||||
PATTERN="$PATTERN."
|
PATTERN="$PATTERN."
|
||||||
fi
|
fi
|
||||||
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
|
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
|
||||||
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'`
|
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`
|
||||||
fi
|
fi
|
||||||
if [ -z "$VERSIONS" ]; then
|
if [ -z "$VERSIONS" ]; then
|
||||||
echo "N/A"
|
echo "N/A"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ../../../nvm.sh
|
||||||
|
|
||||||
|
nvm ls node
|
||||||
|
[ "$?" = "3" ]
|
||||||
|
|
Loading…
Reference in New Issue