Skip to content
Myr

Expanding to full if statements because the shorthand results in non-zero exit codes

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

authored by Alan Quach · committed by Alan Quach · parent 2da44f9 · Browse files · 1 file+18 added−6 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−6 removed

  • other:+18 added−6 removed

1 file+18 added−6 removed

modified:nvm.sh+18 added-6 removed
1468 unmodified lines
1469 fi14701471 if [ "_$VERSION" = '_system' ]; then1472 if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then1473 if [ $silent -ne 1 ]; then1473 [ $silent -ne 1 ] && echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"1474 echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"1475 fi1476 return1477 elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then1478 if [ $silent -ne 1 ]; then1476 [ $silent -ne 1 ] && echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"1479 echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"1480 fi1481 return1482 else1483 if [ $silent -ne 1 ]; then1479 [ $silent -ne 1 ] && echo "System version of node not found." >&21484 echo "System version of node not found." >&21485 fi1486 return 1271487 fi1488 elif [ "_$VERSION" = "_∞" ]; then1489 if [ $silent -ne 1 ]; then1483 [ $silent -ne 1 ] && echo "The alias \"$PROVIDED_VERSION\" leads to an infinite loop. Aborting." >&21490 echo "The alias \"$PROVIDED_VERSION\" leads to an infinite loop. Aborting." >&21491 fi1492 return 81493 fi14941495 # This nvm_ensure_version_installed call can be a performance bottleneck
28 unmodified lines
1524 if [ "$NVM_SYMLINK_CURRENT" = true ]; then1525 command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"1526 fi1527 if nvm_is_iojs_version "$VERSION"; then1528 if [ $silent -ne 1 ]; then1520 [ $silent -ne 1 ] && echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"1529 echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"1530 fi1531 else1532 if [ $silent -ne 1 ]; then1522 [ $silent -ne 1 ] && echo "Now using node $VERSION$(nvm_print_npm_version)"1533 echo "Now using node $VERSION$(nvm_print_npm_version)"1534 fi1535 fi1536 ;;1537 "run" )1538 local provided_version
371 unmodified lines