Use node to get version information if nvm is not present

Fixes #132
This commit is contained in:
Michael Robinson authored and Caio Gondim committed 2016-04-20 11:35:11 +02:00
1 parent d5b375063e
commit 5ca3596f58
2 files changed
+7 -5

No files matched your search

+6 -4
View File
@@ -539,11 +539,13 @@ prompt_nvm() {
return
fi
$(type nvm >/dev/null 2>&1) || return
local nvm_prompt
nvm_prompt=$(nvm current 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
if [[ $(type nvm >/dev/null 2>&1) ]]; then
nvm_prompt=$(nvm current 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
else
nvm_prompt="$(node --version)"
fi
nvm_prompt=${nvm_prompt}
prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$nvm_prompt
}