Added API key validation to prevent unauthorized access
This commit is contained in:
parent
95aa730114
commit
704f4b6f05
@ -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
|
||||
popd "$@" >/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user