1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-23 21:01:58 +00:00

Added nvm.zsh to detect current Node.js version

This commit is contained in:
isquariel 2013-11-08 23:26:05 +04:00
parent e30a1243dc
commit 5c73cb671b

9
lib/nvm.zsh Normal file
View file

@ -0,0 +1,9 @@
# get the node.js version
function nvm_prompt_info() {
[ -f $HOME/.nvm/nvm.sh ] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
nvm_prompt=${nvm_prompt:1}
echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
}