mirror of
https://gitlab.gnome.org/World/fractal.git
synced 2025-05-14 00:02:26 -04:00
37 lines
908 B
Bash
Executable File
37 lines
908 B
Bash
Executable File
#!/bin/sh
|
|
# Depends on: scripts/checks.sh
|
|
|
|
echo "-- Pre-commit checks --"
|
|
echo "To ignore these checks next time, run: git commit --no-verify"
|
|
echo ""
|
|
if scripts/checks.sh; then
|
|
echo ""
|
|
echo "Pre-commit checks result: ok"
|
|
elif [[ $? -eq 2 ]]; then
|
|
echo "A missing dependency was found"
|
|
echo ""
|
|
echo "y: Skip checks and proceed with commit"
|
|
echo "N: Abort commit"
|
|
echo ""
|
|
while true
|
|
do
|
|
echo -n "Skip the pre-commit checks? [y/N]: "; read yn < /dev/tty
|
|
case $yn in
|
|
[Yy]* )
|
|
echo "Skipping checks…"
|
|
exit 0
|
|
;;
|
|
[Nn]* | "" )
|
|
echo "Aborting commit"
|
|
exit 1
|
|
;;
|
|
* )
|
|
echo "Invalid input"
|
|
;;
|
|
esac
|
|
done
|
|
else
|
|
echo "Pre-commit checks result: fail"
|
|
echo "Aborting commit"
|
|
exit 1
|
|
fi |