diff --git a/aicommit_groq b/aicommit_groq index 9541caf..4bacba0 100755 --- a/aicommit_groq +++ b/aicommit_groq @@ -3,6 +3,11 @@ pushd $(pwd) "$@" >/dev/null TMP_FILE="/tmp/aicommit" +if [[ -z "${GROQ_API_KEY}" ]]; then + echo "API key not set." + exit 1 +fi + system="You are an expert programmer that values clear, unambiguous communication and are specialized in generating concise and informative git commit messages. Only reply with the commit message and nothing else." diff=$(git diff --cached) @@ -34,4 +39,4 @@ fi git commit -e -m "$(cat ${TMP_FILE})" && rm ${TMP_FILE} -popd "$@" >/dev/null \ No newline at end of file +popd "$@" >/dev/null