From c1ca246f52f51d240b57a1e86368e841f880f8d9 Mon Sep 17 00:00:00 2001 From: Wesley Scholl <128409641+wesleyscholl@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:43:17 -0400 Subject: [PATCH] TEST-1234 Fix: Escape double quotes in Gemini API request Escape double quotes in the Gemini API request to prevent errors. --- git-commit-push-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-commit-push-script.sh b/git-commit-push-script.sh index 2942bdf..930abbe 100755 --- a/git-commit-push-script.sh +++ b/git-commit-push-script.sh @@ -17,7 +17,7 @@ diff=$(git diff --cached) diff=$(echo $diff | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/\n/\\n/g') # Prepare the Gemini API request -gemini_request='{"contents":[{"parts":[{"text": "Write a git commit message (commit message title 72 character maximum and commit message summary 50 character maxiumum) for the following git diff: '"$diff"' The format should be as follows (without titles, back ticks, markdown fomatting, or template strings): (2 new lines) "}]}]}' +gemini_request='{"contents":[{"parts":[{"text": "Write a git commit message (commit message title 72 character maximum and commit message summary 50 character maxiumum) for the following git diff: '"$diff"' The format should be as follows (without titles, back ticks, markdown fomatting): (2 new lines) "}]}]}' # Get commit message from Gemini API commit_message=$(curl -s \