From 5c73cb671bde7a151a7a36fe782ce44dba1b0531 Mon Sep 17 00:00:00 2001 From: isquariel Date: Fri, 8 Nov 2013 23:26:05 +0400 Subject: [PATCH] Added nvm.zsh to detect current Node.js version --- lib/nvm.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/nvm.zsh diff --git a/lib/nvm.zsh b/lib/nvm.zsh new file mode 100644 index 000000000..5cadf7061 --- /dev/null +++ b/lib/nvm.zsh @@ -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}" +}