Skip to content
Myr

Instead of using expr to check if paths need cleaning, compare cleaned paths to original paths and export appropriately.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 5ef092b · Browse files · 1 file+18 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−12 removed

  • other:+18 added−12 removed

1 file+18 added−12 removed

modified:nvm.sh+18 added-12 removed
605 unmodified lines
606 done607608 ;;609 "deactivate" )610 if [ `expr "$PATH" : ".*$NVM_DIR/.*/bin.*"` != 0 ] ; then611 export PATH=`nvm_strip_path "$PATH" "/bin"`610 local NEWPATH611 NEWPATH="$(nvm_strip_path "$PATH" "/bin")"612 if [ "$PATH" = "$NEWPATH" ]; then613 echo "Could not find $NVM_DIR/*/bin in \$PATH" >&2614 else615 export PATH="$NEWPATH"616 hash -r617 echo "$NVM_DIR/*/bin removed from \$PATH"614 else615 echo "Could not find $NVM_DIR/*/bin in \$PATH" >&2618 fi617 if [ `expr "$MANPATH" : ".*$NVM_DIR/.*/share/man.*"` != 0 ] ; then618 export MANPATH=`nvm_strip_path "$MANPATH" "/share/man"`619 echo "$NVM_DIR/*/share/man removed from \$MANPATH"620 else619620 NEWPATH="$(nvm_strip_path "$MANPATH" "/share/man")"621 if [ "$MANPATH" = "$NEWPATH" ]; then622 echo "Could not find $NVM_DIR/*/share/man in \$MANPATH" >&2622 fi623 if [ `expr "$NODE_PATH" : ".*$NVM_DIR/.*/lib/node_modules.*"` != 0 ] ; then624 export NODE_PATH=`nvm_strip_path "$NODE_PATH" "/lib/node_modules"`625 echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"623 else624 export MANPATH="$NEWPATH"625 echo "$NVM_DIR/*/share/man removed from \$MANPATH"626 fi627628 NEWPATH="$(nvm_strip_path "$NODE_PATH" "/lib/node_modules")"629 if [ "$NODE_PATH" = "$NEWPATH" ]; then630 echo "Could not find $NVM_DIR/*/lib/node_modules in \$NODE_PATH" >&2631 else632 export NODE_PATH="$NEWPATH"633 echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"634 fi635 ;;636 "use" )637 if [ $# -eq 0 ]; then
243 unmodified lines