nvm.zsh 305 B

123456789
  1. # get the node.js version
  2. function nvm_prompt_info() {
  3. [ -f "$HOME/.nvm/nvm.sh" ] || return
  4. local nvm_prompt
  5. nvm_prompt=$(node -v 2>/dev/null)
  6. [[ "${nvm_prompt}x" == "x" ]] && return
  7. nvm_prompt=${nvm_prompt:1}
  8. echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
  9. }