Removing global NVM_SILENT and adding/using '--silent' option to nvm use instead
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 9419794 · Browse files · 1 file·+15 added−10 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+15 added−10 removed
- other:+15 added−10 removed
Provenance
- Commit
88a5078- Tree
6d14f30- Author
Alan Quach <aquach@netflix.com>- Committer
Alan Quach <aquach@netflix.com>- Parent
9419794
1 file changed+15 added−10 removed
modified:nvm.sh+15 added-10 removed
59 unmodified lines60 [ "$(nvm deactivate >/dev/null 2>&1 && command -v iojs)" != '' ]61 }62 63 nvm_print_npm_version() {64- if [ "$NVM_SILENT" != "true" ] && nvm_has "npm"; then64+ if nvm_has "npm"; then65 echo " (npm v$(npm --version 2>/dev/null))"66 fi67 }68 1117 unmodified lines1186 echo " nvm help Show this message"1187 echo " nvm --version Print out the latest released version of nvm"1188 echo " nvm install [-s] <version> Download and install a <version>, [-s] from source. Uses .nvmrc if available"1189 echo " nvm uninstall <version> Uninstall a version"1190- echo " nvm use <version> Modify PATH to use <version>. Uses .nvmrc if available"1190+ echo " nvm use [--silent] <version> Modify PATH to use <version>. Uses .nvmrc if available"1191 echo " nvm run <version> [<args>] Run <version> with <args> as arguments. Uses .nvmrc if available for <version>"1192 echo " nvm current Display currently activated version"1193 echo " nvm ls List installed versions"1194 echo " nvm ls <version> List versions matching a given description"249 unmodified lines1444 fi1445 ;;1446 "use" )1447 local PROVIDED_VERSION1448+ local silent1449+ silent=01450+ if [ "$2" = '--silent' ]; then1451+ silent=11452+ shift1453+ fi1454+1455 if [ $# -eq 1 ]; then1456 nvm_rc_version1457 if [ -n "$NVM_RC_VERSION" ]; then1458 PROVIDED_VERSION="$NVM_RC_VERSION"10 unmodified lines1469 fi1470 1471 if [ "_$VERSION" = '_system' ]; then1472 if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then1466- echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"1473+ [ $silent -ne 1 ] && echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"1474 return1475 elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then1469- echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"1476+ [ $silent -ne 1 ] && echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"1477 return1478 else1479 echo "System version of node not found." >&21480 return 12735 unmodified lines1516 if [ "$NVM_SYMLINK_CURRENT" = true ]; then1517 command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"1518 fi1519 if nvm_is_iojs_version "$VERSION"; then1513- echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"1520+ [ $silent -ne 1 ] && echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"1521 else1515- echo "Now using node $VERSION$(nvm_print_npm_version)"1522+ [ $silent -ne 1 ] && echo "Now using node $VERSION$(nvm_print_npm_version)"1523 fi1524 ;;1525 "run" )1526 local provided_version361 unmodified lines1888 elif nvm_rc_version >/dev/null 2>&1; then1889 nvm install >/dev/null1890 fi1891 elif [ -n "$VERSION" ]; then1885- NVM_SILENT="true"1886- nvm use "$VERSION" >/dev/null1892+ nvm use --silent "$VERSION" >/dev/null1887- unset NVM_SILENT1893 elif nvm_rc_version >/dev/null 2>&1; then1889- nvm use >/dev/null1894+ nvm use --silent >/dev/null1895 fi1896 1897 } # this ensures the entire script is downloaded #