Remove some new bashisms

master
Dr. Kibitz 2014-02-18 21:57:52 -08:00
parent 9a0c269713
commit a9be598241
1 changed files with 3 additions and 3 deletions

6
nvm.sh
View File

@ -393,7 +393,7 @@ nvm() {
else
echo "Could not find $NVM_DIR/*/share/man in \$MANPATH"
fi
if [[ $NODE_PATH == *$NVM_DIR/*/lib/node_modules* ]]; then
if [ `expr $NODE_PATH : ".*$NVM_DIR/.*/lib/node_modules.*"` != 0 ] ; then
export NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}${NODE_PATH#*$NVM_DIR/*/lib/node_modules:}
echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"
else
@ -438,7 +438,7 @@ nvm() {
else
MANPATH="$NVM_DIR/$VERSION/share/man:$MANPATH"
fi
if [[ $NODE_PATH == *$NVM_DIR/*/lib/node_modules* ]]; then
if [ `expr $NODE_PATH : ".*$NVM_DIR/.*/lib/node_modules.*"` != 0 ]; then
NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules}
else
NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"
@ -462,7 +462,7 @@ nvm() {
echo "$VERSION version is not installed yet"
return;
fi
if [[ $NODE_PATH == *$NVM_DIR/*/lib/node_modules* ]]; then
if [ `expr $NODE_PATH : ".*$NVM_DIR/.*/lib/node_modules.*"` != 0 ]; then
RUN_NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules}
else
RUN_NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"