@@ -3587,18 +3587,22 @@ nvm() {
3587
3587
local NVMRC_SAVE_TEXT
3588
3588
NVMRC_SAVE_TEXT=' '
3589
3589
if [ " ${NVM_WRITE_TO_NVMRC} " -eq 1 ] && [ " ${VERSION} " != ' ∞' ] && [ " ${VERSION} " != ' N/A' ]; then
3590
- echo " $VERSION " | tee " ${PWD} " /.nvmrc > /dev/null || nvm_err " WARNING: Unable write version to .nvmrc"
3590
+ echo " $VERSION " | tee " ${PWD} " /.nvmrc > /dev/null || {
3591
+ nvm_err " Unable to write version to .nvmrc, aborted."
3592
+ exit 3
3593
+ }
3591
3594
NVMRC_SAVE_TEXT=" (saved to .nvmrc)"
3592
3595
fi
3593
3596
if [ " _${VERSION} " = ' _system' ]; then
3594
3597
if nvm_has_system_node && nvm deactivate " ${NVM_SILENT_ARG-} " > /dev/null 2>&1 ; then
3595
3598
if [ " ${NVM_SILENT:- 0} " -ne 1 ]; then
3596
- nvm_echo " Now using system version of node: $( node -v 2> /dev/null) $( nvm_print_npm_version) $NVMRC_SAVE_TEXT "
3599
+ nvm_echo " Now using system version of node:
3600
+ $( node -v 2> /dev/null) $( nvm_print_npm_version) ${NVMRC_SAVE_TEXT} "
3597
3601
fi
3598
3602
return
3599
3603
elif nvm_has_system_iojs && nvm deactivate " ${NVM_SILENT_ARG-} " > /dev/null 2>&1 ; then
3600
3604
if [ " ${NVM_SILENT:- 0} " -ne 1 ]; then
3601
- nvm_echo " Now using system version of io.js: $( iojs --version 2> /dev/null) $( nvm_print_npm_version) "
3605
+ nvm_echo " Now using system version of io.js: $( iojs --version 2> /dev/null) $( nvm_print_npm_version) ${NVMRC_SAVE_TEXT} "
3602
3606
fi
3603
3607
return
3604
3608
elif [ " ${NVM_SILENT:- 0} " -ne 1 ]; then
@@ -3647,9 +3651,9 @@ nvm() {
3647
3651
NVM_USE_OUTPUT=' '
3648
3652
if [ " ${NVM_SILENT:- 0} " -ne 1 ]; then
3649
3653
if nvm_is_iojs_version " ${VERSION} " ; then
3650
- NVM_USE_OUTPUT=" Now using io.js $( nvm_strip_iojs_prefix " ${VERSION} " ) $( nvm_print_npm_version) "
3654
+ NVM_USE_OUTPUT=" Now using io.js $( nvm_strip_iojs_prefix " ${VERSION} " ) $( nvm_print_npm_version) ${NVMRC_SAVE_TEXT} "
3651
3655
else
3652
- NVM_USE_OUTPUT=" Now using node ${VERSION} $( nvm_print_npm_version) $NVMRC_SAVE_TEXT "
3656
+ NVM_USE_OUTPUT=" Now using node ${VERSION} $( nvm_print_npm_version) ${ NVMRC_SAVE_TEXT} "
3653
3657
fi
3654
3658
fi
3655
3659
if [ " _${VERSION} " != " _system" ]; then
0 commit comments