summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/hooks/pre-commit0
-rwxr-xr-xlib/install-hooks10
-rwxr-xr-xlib/lib5
3 files changed, 15 insertions, 0 deletions
diff --git a/lib/hooks/pre-commit b/lib/hooks/pre-commit
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/lib/hooks/pre-commit
diff --git a/lib/install-hooks b/lib/install-hooks
new file mode 100755
index 0000000..f4b7aff
--- /dev/null
+++ b/lib/install-hooks
@@ -0,0 +1,10 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash --pure
+#! nix-shell -p bash git
+
+set -euo pipefail
+echo "Reinstalling git hooks"
+
+git_root=$(git rev-parse --show-toplevel) || exit 1
+rm -rf $git_root/.git/hooks
+ln -s $git_root/lib/hooks $git_root/.git/hooks
\ No newline at end of file
diff --git a/lib/lib b/lib/lib
new file mode 100755
index 0000000..549b705
--- /dev/null
+++ b/lib/lib
@@ -0,0 +1,5 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash --pure
+#! nix-shell -p bash git
+echo $PWD
+source "${BASH_SOURCE%/*}/install-hooks"
\ No newline at end of file