diff --git a/nvm.sh b/nvm.sh index 5e3d9f7..b76655d 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1789,13 +1789,14 @@ nvm() { if [ "$NVM_SYMLINK_CURRENT" = true ]; then command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current" fi + local NVM_USE_OUTPUT if nvm_is_iojs_version "$VERSION"; then if [ $NVM_USE_SILENT -ne 1 ]; then - echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)" + NVM_USE_OUTPUT="Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)" fi else if [ $NVM_USE_SILENT -ne 1 ]; then - echo "Now using node $VERSION$(nvm_print_npm_version)" + NVM_USE_OUTPUT="Now using node $VERSION$(nvm_print_npm_version)" fi fi if [ "_$VERSION" != "_system" ]; then @@ -1811,6 +1812,9 @@ nvm() { return 11 fi fi + if [ -n "$NVM_USE_OUTPUT" ]; then + echo "$NVM_USE_OUTPUT" + fi ;; "run" ) local provided_version