Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F116513
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
771 B
Referenced Files
None
Subscribers
None
View Options
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
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Dec 1, 6:32 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41773
Default Alt Text
(771 B)
Attached To
Mode
R26 prometheus.ex
Attached
Detach File
Event Timeline
Log In to Comment