From 61585251f51efdef2ff261429151238f47fb059a Mon Sep 17 00:00:00 2001 From: Carter Thaxton Date: Sat, 9 Apr 2011 14:47:50 -0700 Subject: [PATCH] Force unaliased use of ls, for those of us who alias ls in their shell --- nvm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nvm.sh b/nvm.sh index 6f107ec..bae552b 100644 --- a/nvm.sh +++ b/nvm.sh @@ -52,17 +52,17 @@ nvm_version() PATTERN='*.*.' fi 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 fi 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 if [ ! "$VERSION" ]; then echo "N/A" return 13 elif [ -e "$NVM_DIR/$VERSION" ]; then - (cd $NVM_DIR; ls -dG "$VERSION") + (cd $NVM_DIR; \ls -dG "$VERSION") else echo "$VERSION" fi @@ -181,7 +181,7 @@ nvm() "alias" ) mkdir -p $NVM_DIR/alias 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` VERSION=`nvm_version $DEST` if [ "$DEST" = "$VERSION" ]; then