optimize(exit): streamline exit conditions

This commit is contained in:
camAtGitHub 2023-04-20 20:05:20 +10:00
parent f040fe8177
commit 798e240b56

View File

@ -313,7 +313,7 @@ while $running; do
if [ -z "$pipe_mode_prompt" ]; then
echo -e "\nEnter a prompt:"
read -e prompt
if [ "$prompt" != "exit" ] && [ "$prompt" != "q" ]; then
if [[ ! $prompt =~ ^(exit|q)$ ]]; then
echo -ne $PROCESSING_LABEL
fi
else
@ -323,7 +323,7 @@ while $running; do
CHATGPT_CYAN_LABEL=""
fi
if [ "$prompt" == "exit" ] || [ "$prompt" == "q" ]; then
if [[ $prompt =~ ^(exit|q)$ ]]; then
running=false
elif [[ "$prompt" =~ ^image: ]]; then
request_to_image "$prompt"