File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 54
54
# $1 should be the response body
55
55
handle_error () {
56
56
if echo " $1 " | jq -e ' .error' > /dev/null; then
57
- echo -e " Your request to Open AI API failed: \033[0;31m$( echo $1 | jq -r ' .error.type' ) \033[0m"
58
- echo $1 | jq -r ' .error.message'
57
+ echo -e " Your request to Open AI API failed: \033[0;31m$( echo " $1 " | jq -r ' .error.type' ) \033[0m"
58
+ echo " $1 " | jq -r ' .error.message'
59
59
exit 1
60
60
fi
61
61
}
@@ -296,7 +296,7 @@ while $running; do
296
296
elif [[ " $prompt " =~ ^image: ]]; then
297
297
request_to_image " $prompt "
298
298
handle_error " $image_response "
299
- image_url=$( echo $image_response | jq -r ' .data[0].url' )
299
+ image_url=$( echo " $image_response " | jq -r ' .data[0].url' )
300
300
echo -e " $OVERWRITE_PROCESSING_LINE "
301
301
echo -e " ${CHATGPT_CYAN_LABEL} Your image was created. \n\nLink: ${image_url} \n"
302
302
You can’t perform that action at this time.
0 commit comments