summary refs log tree commit diff
path: root/lib/install-hooks
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-03 01:31:00 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commit5492701b329e844d1b9097c97bc8afdd9cd72c97 (patch)
treeec6ea9949cd00535b6e15864ced2b1a807c632ab /lib/install-hooks
parentAdd temporary matrix server (diff)
downloadRory-Open-Architecture-5492701b329e844d1b9097c97bc8afdd9cd72c97.tar.xz
Add dotfiles, portable changes
Diffstat (limited to 'lib/install-hooks')
-rwxr-xr-xlib/install-hooks10
1 files changed, 10 insertions, 0 deletions
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