summaryrefslogtreecommitdiff
path: root/scripts/git-pre-commit-hook.sh
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2025-04-08 01:07:22 +0000
committerLinnnus <[email protected]>2025-04-08 01:07:34 +0000
commit8dd0c4f27aae02dd60f029db4cf03f9902cba26f (patch)
tree829c4bc0917f6615c55ae61d49932179c038c1e5 /scripts/git-pre-commit-hook.sh
feat: Initial commit
At this point we have some allocation routines but no work on the actual language has been done.
Diffstat (limited to 'scripts/git-pre-commit-hook.sh')
-rwxr-xr-xscripts/git-pre-commit-hook.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/git-pre-commit-hook.sh b/scripts/git-pre-commit-hook.sh
new file mode 100755
index 0000000..d6297e7
--- /dev/null
+++ b/scripts/git-pre-commit-hook.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e -u -o pipefail
+
+# All of this is output for humans, not programs.
+exec >&2
+
+unit="$(scripts/unit_test.sh)"
+if [ $? -ne 0 ]; then
+ echo "$unit"
+ echo "You have failing unit tests. Aborting git commit."
+ exit 1
+fi