Skip to content

Commit

Permalink
fixing variable expansion in echo
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonesto committed Jan 5, 2024
1 parent b72eac6 commit 2f221c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions igpt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ do

if [ "$HTTP_STATUS" = "200" ]; then

TEXT=$( echo $OUTPUT | python -c "import sys, json; print(json.load(sys.stdin)['choices'][0]['text'].strip())" 2>/dev/null)
TEXT=$( echo "$OUTPUT" | python -c "import sys, json; print(json.load(sys.stdin)['choices'][0]['text'].strip())" 2>/dev/null)
print_output "$TEXT"

elif [ "$HTTP_STATUS" = "000" ]; then
Expand All @@ -404,7 +404,7 @@ do

else

ERROR=$( echo $OUTPUT | python -c "import sys, json; print(json.load(sys.stdin)['error']['message'])" 2>/dev/null )
ERROR=$( echo "$OUTPUT" | python -c "import sys, json; print(json.load(sys.stdin)['error']['message'])" 2>/dev/null )

if is_not_empty_or_null $ERROR; then
print_info "$ERROR"
Expand Down

0 comments on commit 2f221c2

Please sign in to comment.