diff --git a/aicommit b/aicommit index d0150fb..43c5a75 100755 --- a/aicommit +++ b/aicommit @@ -4,7 +4,7 @@ set -o pipefail ARGS=("${@-}") -pushd "$(pwd)" "$@" >/dev/null +pushd "$(pwd)" >/dev/null TMP_FILE="/tmp/aicommit" @@ -35,9 +35,11 @@ message=$( ".message = $(jq -R -s '@json' <<<"${message_cat}")" ) +# trunk-ignore(shellcheck/SC2091) +# trunk-ignore(shellcheck/SC2310) if $(hasFlag -r --reset); then - curl -s -X POST https://infer.x64.world/reset-conversation "$@" >/dev/null - if ! curl -s -X POST https://infer.x64.world/reset-conversation "$@" >/dev/null; then + echo "resetting AI history." + if ! curl -s -X POST https://infer.x64.world/reset-conversation >/dev/null; then echo "Failed to reset conversation." exit 1 fi @@ -48,6 +50,7 @@ curl -s "https://infer.x64.world/chat" \ -H "Content-Type: application/json" \ -d "${message}" | jq -r '.content | gsub("\""; "")' >"${TMP_FILE}" +# trunk-ignore(shellcheck/SC2181) if [[ 0 -ne $? ]]; then echo "Failed to get response." exit 1 @@ -55,4 +58,4 @@ fi git commit -e -m "$(cat "${TMP_FILE}")" && rm "${TMP_FILE}" -popd "$@" >/dev/null +popd >/dev/null