aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorSudarshan Wadkar <git@wadkar.net>2016-03-15 03:57:30 +0300
committerSudarshan Wadkar <git@wadkar.net>2016-03-15 03:57:30 +0300
commitf7b7ff21c9885a2a94f174336416dafa8b96c470 (patch)
tree69ba9e3e60e7fbc888905eebdc2baa16be3f7764 /powerlevel9k.zsh-theme
parent88fd11a8657eaefa5477d07538dbbbc24b905d2c (diff)
Fix NVM prompt to return if not used
This commit changes nvm prompt setup to return immediately if no node version is installed/available. Currently, prompt complains for lack of global node version. Specifically, if you install nvm (from brew or manually) and do not have global node installed (or set), then the prompt should not set or show anything. This commit ensures this by immediately returning if `nvm current` returns "none".
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme1
1 files changed, 1 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 2ef4fe3c..c69c32c6 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -560,6 +560,7 @@ prompt_node_version() {
prompt_nvm() {
[[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return
local node_version=$(nvm current)
+ [[ ${node_version} = "none" ]] && return
local nvm_default=$(cat $NVM_DIR/alias/default)
[[ -z "${node_version}" ]] && return
[[ "$node_version" =~ "$nvm_default" ]] && return