android-samples/hooks/pre-commit
Enrique López Mañas 588287af6e
docs: added hook sample (#1462)
* docs: added hook sample

* docs: changed default value to DEFAULT_API_KEY
2024-01-26 09:51:18 -08:00

14 lines
449 B
Bash

#!/bin/bash
## This hook provides an example that prevents the API Key from being committed.
## The file can be adapted to your needs, but ultimately this hook will reject the commit if the MAPS_API_KEY
## has been modified. Git Hooks are located in the folder .git/hooks
FILE="local.defaults.properties"
if ! grep -q "^MAPS_API_KEY=DEFAULT_API_KEY" "$FILE"; then
echo "Error: Commit rejected. Invalid content in $FILE."
exit 1
fi
exit 0