Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Avoid carrying over test status when no node version is installed #96

Merged
merged 1 commit into from

2 participants

@caio

When sourcing nvm.sh, if there are no version of node installed the command
nvm ls default silentry fails, however it's return status code ($?) is
still set to non-zero, which means an error.

This patch simply avoids this issue by making sure the status code after
sourcing is ok so that people that put the returned status codes in their
command line prompt don't get an error every time nvm.sh is sourced.

@caio caio Avoid carrying over test status when no node version is installed
When sourcing nvm.sh, if there are no version of node installed the command
`nvm ls default` silentry fails, however it's return status code (`$?`) is
still set to non-zero, which means an error.

This patch simply avoids this issue by making sure the status code after
sourcing is ok so that people that put the returned status codes in their
command line prompt don't get an error every time `nvm.sh` is sourced.
53cfd2d
@creationix creationix merged commit d9f25f8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 18, 2012
  1. @caio

    Avoid carrying over test status when no node version is installed

    caio authored
    When sourcing nvm.sh, if there are no version of node installed the command
    `nvm ls default` silentry fails, however it's return status code (`$?`) is
    still set to non-zero, which means an error.
    
    This patch simply avoids this issue by making sure the status code after
    sourcing is ok so that people that put the returned status codes in their
    command line prompt don't get an error every time `nvm.sh` is sourced.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  nvm.sh
View
2  nvm.sh
@@ -283,4 +283,4 @@ nvm()
esac
}
-nvm ls default >/dev/null 2>&1 && nvm use default >/dev/null
+nvm ls default &>/dev/null && nvm use default >/dev/null || true
Something went wrong with that request. Please try again.