Merge pull request #24 from carter-thaxton/master.
Force use of unaliased version of ls from shellmaster
commit
d509e32c6f
8
nvm.sh
8
nvm.sh
|
@ -52,17 +52,17 @@ nvm_version()
|
||||||
PATTERN='*.*.'
|
PATTERN='*.*.'
|
||||||
fi
|
fi
|
||||||
if [ "$PATTERN" = 'all' ]; then
|
if [ "$PATTERN" = 'all' ]; then
|
||||||
(cd $NVM_DIR; ls -dG v* 2>/dev/null || echo "N/A")
|
(cd $NVM_DIR; \ls -dG v* 2>/dev/null || echo "N/A")
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ ! "$VERSION" ]; then
|
if [ ! "$VERSION" ]; then
|
||||||
VERSION=`(cd $NVM_DIR; ls -d v${PATTERN}* 2>/dev/null) | sort -t. -k 2,1n -k 2,2n -k 3,3n | tail -n1`
|
VERSION=`(cd $NVM_DIR; \ls -d v${PATTERN}* 2>/dev/null) | sort -t. -k 2,1n -k 2,2n -k 3,3n | tail -n1`
|
||||||
fi
|
fi
|
||||||
if [ ! "$VERSION" ]; then
|
if [ ! "$VERSION" ]; then
|
||||||
echo "N/A"
|
echo "N/A"
|
||||||
return 13
|
return 13
|
||||||
elif [ -e "$NVM_DIR/$VERSION" ]; then
|
elif [ -e "$NVM_DIR/$VERSION" ]; then
|
||||||
(cd $NVM_DIR; ls -dG "$VERSION")
|
(cd $NVM_DIR; \ls -dG "$VERSION")
|
||||||
else
|
else
|
||||||
echo "$VERSION"
|
echo "$VERSION"
|
||||||
fi
|
fi
|
||||||
|
@ -181,7 +181,7 @@ nvm()
|
||||||
"alias" )
|
"alias" )
|
||||||
mkdir -p $NVM_DIR/alias
|
mkdir -p $NVM_DIR/alias
|
||||||
if [ $# -le 2 ]; then
|
if [ $# -le 2 ]; then
|
||||||
(cd $NVM_DIR/alias && for ALIAS in `ls $2* 2>/dev/null`; do
|
(cd $NVM_DIR/alias && for ALIAS in `\ls $2* 2>/dev/null`; do
|
||||||
DEST=`cat $ALIAS`
|
DEST=`cat $ALIAS`
|
||||||
VERSION=`nvm_version $DEST`
|
VERSION=`nvm_version $DEST`
|
||||||
if [ "$DEST" = "$VERSION" ]; then
|
if [ "$DEST" = "$VERSION" ]; then
|
||||||
|
|
Loading…
Reference in New Issue