diff --git a/aicommit b/aicommit index b0af910..177dcaf 100755 --- a/aicommit +++ b/aicommit @@ -59,10 +59,13 @@ if $(hasFlag -r --reset); then kill "${SPINNER}" fi +spin "AI is thinking." & +SPINNER="$!" curl -s "https://infer.x64.world/chat" \ -X POST \ -H "Content-Type: application/json" \ -d "${message}" | jq -r '.content | gsub("\""; "")' >"${TMP_FILE}" +kill "${SPINNER}" # trunk-ignore(shellcheck/SC2181) if [[ 0 -ne $? ]]; then @@ -70,6 +73,7 @@ if [[ 0 -ne $? ]]; then exit 1 fi + git commit -e -m "$(cat "${TMP_FILE}")" && rm "${TMP_FILE}" popd >/dev/null