[A] COMMAND_RESULT

This commit is contained in:
chesteryue 2020-11-10 00:37:48 +08:00
parent 644b58782a
commit 573a2e930d

View file

@ -53,13 +53,16 @@ function update_command_status() {
local arrow=""; local arrow="";
local color_reset="%{$reset_color%}"; local color_reset="%{$reset_color%}";
local reset_font="%{$fg_no_bold[white]%}"; local reset_font="%{$fg_no_bold[white]%}";
if $1; COMMAND_RESULT=$1;
if $COMMAND_RESULT;
then then
arrow="%{$fg_bold[red]%}❱%{$fg_bold[yellow]%}❱%{$fg_bold[green]%}❱"; arrow="%{$fg_bold[red]%}❱%{$fg_bold[yellow]%}❱%{$fg_bold[green]%}❱";
else else
arrow="%{$fg_bold[red]%}❱❱❱"; arrow="%{$fg_bold[red]%}❱❱❱";
fi fi
COMMAND_STATUS="${arrow}${reset_font}${color_reset}"; COMMAND_STATUS="${arrow}${reset_font}${color_reset}";
echo $COMMAND_RESULT
export COMMAND_RESULT=$COMMAND_RESULT
} }
update_command_status true; update_command_status true;