From 1975f1dc6d19c5d7ee434e937fcb462b6151aca7 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 4 Oct 2023 06:58:26 +0900 Subject: [PATCH] themes/purity: Apply refactoring in edsonarios --- themes/purity/purity.theme.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themes/purity/purity.theme.sh b/themes/purity/purity.theme.sh index 20bbdf1..5c95d78 100644 --- a/themes/purity/purity.theme.sh +++ b/themes/purity/purity.theme.sh @@ -13,8 +13,12 @@ GIT_THEME_PROMPT_SUFFIX=" ${_omb_prompt_reset_color})" STATUS_THEME_PROMPT_BAD="${_omb_prompt_bold_brown}❯${_omb_prompt_reset_color}${_omb_prompt_normal} " STATUS_THEME_PROMPT_OK="${_omb_prompt_bold_green}❯${_omb_prompt_reset_color}${_omb_prompt_normal} " -function _omb_theme_PROMPT_COMMAND() { - local ret_status="$( [ $? -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")" +function _omb_theme_PROMPT_COMMAND { + if (($? == 0)); then + local ret_status=${STATUS_THEME_PROMPT_BAD-} + else + local ret_status=${STATUS_THEME_PROMPT_OK-} + fi PS1="\n${_omb_prompt_navy}\w $(scm_prompt_info)\n${ret_status} " }