From b8f4b0ce899f0ece8ad1ff2947de5fa2b71aa970 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 1 Aug 2018 11:24:45 -0500 Subject: [PATCH] cleanup theme --- env/nodez.theme.bash | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/env/nodez.theme.bash b/env/nodez.theme.bash index 63c56a8..9ee2716 100644 --- a/env/nodez.theme.bash +++ b/env/nodez.theme.bash @@ -18,16 +18,21 @@ __nodez_ne() { if [[ -v NODE_VIRTUAL_ENV ]]; then env="${NODE_VIRTUAL_ENV##*/}" fi - if [[ -v NODE_VERSION ]]; then - [ "$env" != "" ] && echo "[${bold_yellow}$env${normal}" - else - [ "$env" != "" ] && echo "[${bold_yellow}$env${normal}]" + if [[ "$env" != "" ]]; then + env="[${bold_yellow}$env${normal}" + if [[ ! -v NODE_VERSION ]]; then + env+="]" + fi + echo "$env" fi } __nodez_nv() { - [[ -v NODE_VERSION ]] \ - && echo "→${__nodez_char_node}${NODE_VERSION}${__nodez_char_npm}${NPM_VERSION}]" + if [[ -v NODE_VERSION ]]; then + local nv="=${__nodez_char_node}${NODE_VERSION}" + nv+="${__nodez_char_npm}${NPM_VERSION}]" + echo "$nv" + fi } __nodez_scm_prompt() {