Merge pull request #705 from joliss/performance

Improve startup performance. Closes #703
master
Jordan Harband 2015-04-02 16:59:38 -07:00
commit 3401d15a18
1 changed files with 3 additions and 1 deletions

4
nvm.sh
View File

@ -1347,6 +1347,8 @@ nvm() {
return 8 return 8
fi fi
# This nvm_ensure_version_installed call can be a performance bottleneck
# on shell startup. Perhaps we can optimize it away or make it faster.
nvm_ensure_version_installed "$PROVIDED_VERSION" nvm_ensure_version_installed "$PROVIDED_VERSION"
EXIT_CODE=$? EXIT_CODE=$?
if [ "$EXIT_CODE" != "0" ]; then if [ "$EXIT_CODE" != "0" ]; then
@ -1718,7 +1720,7 @@ if nvm_supports_source_options && [ "_$1" = "_--install" ]; then
elif nvm_rc_version >/dev/null 2>&1; then elif nvm_rc_version >/dev/null 2>&1; then
nvm install >/dev/null nvm install >/dev/null
fi fi
elif nvm ls default >/dev/null; then elif nvm_alias default >/dev/null 2>&1; then
nvm use default >/dev/null nvm use default >/dev/null
elif nvm_rc_version >/dev/null 2>&1; then elif nvm_rc_version >/dev/null 2>&1; then
nvm use >/dev/null nvm use >/dev/null