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 else
echo "Could not find $NVM_DIR/*/share/man in \$MANPATH" echo "Could not find $NVM_DIR/*/share/man in \$MANPATH"
fi 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:} 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" echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"
else else
@ -438,7 +438,7 @@ nvm() {
else else
MANPATH="$NVM_DIR/$VERSION/share/man:$MANPATH" MANPATH="$NVM_DIR/$VERSION/share/man:$MANPATH"
fi 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} NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules}
else else
NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH" NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"
@ -462,7 +462,7 @@ nvm() {
echo "$VERSION version is not installed yet" echo "$VERSION version is not installed yet"
return; return;
fi 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} RUN_NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules}
else else
RUN_NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH" RUN_NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"