mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-14 01:40:09 +00:00
a7de0fabd7
* Export $NVM_DIR if it doesn't exist and use it when looking for nvm * Use $NVM_DIR when looking for nvm for completion * Use $NVM_DIR when looking for nvm in nvm_prompt_info
9 lines
305 B
Bash
9 lines
305 B
Bash
# get the node.js version
|
|
function nvm_prompt_info() {
|
|
[[ -f "$NVM_DIR/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}"
|
|
}
|