Page MenuHomePhorge

No OneTemporary

Size
771 B
Referenced Files
None
Subscribers
None
diff --git a/bin/checks.sh b/bin/checks.sh
new file mode 100755
index 0000000..b5476ee
--- /dev/null
+++ b/bin/checks.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+MIX_ENV=test mix credo --strict && MIX_ENV=test mix test
diff --git a/bin/pre-commit.sh b/bin/pre-commit.sh
new file mode 100755
index 0000000..f7f90ff
--- /dev/null
+++ b/bin/pre-commit.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+if [ $# -eq 0 ]; then
+ git stash -q --keep-index
+ ./bin/checks.sh
+ RESULT=$?
+ git stash pop -q
+ [ $RESULT -ne 0 ] && exit 1
+ exit 0
+else
+ if [ $1 = "install" ]; then
+ ln -s `pwd`/bin/pre-commit.sh .git/hooks/pre-commit
+ elif [ $1 = "uninstall" ]; then
+ rm .git/hooks/pre-commit
+ else
+ echo "Unknown argument $1"
+ exit 1
+ fi
+fi

File Metadata

Mime Type
text/x-diff
Expires
Sun, Dec 1, 6:32 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41773
Default Alt Text
(771 B)

Event Timeline