nvm plugin improvements (#5265)

* 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
This commit is contained in:
Luke Childs authored and Marc Cornellà committed 2016-08-07 19:36:44 +02:00
1 parent 7654b16b39
commit a7de0fabd7
3 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# get the node.js version
function nvm_prompt_info() {
[ -f "$HOME/.nvm/nvm.sh" ] || return
[[ -f "$NVM_DIR/nvm.sh" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return