diff --git a/.githooks/post-merge b/.githooks/post-merge new file mode 100755 index 0000000..00a9c1e --- /dev/null +++ b/.githooks/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo make install diff --git a/.githooks/setup b/.githooks/setup new file mode 100755 index 0000000..37281e6 --- /dev/null +++ b/.githooks/setup @@ -0,0 +1,15 @@ +#!/bin/sh + +script_name=$(basename "$0") +if ! repo_root=$(git rev-parse --show-toplevel); then + echo "Not a git repository (or any of the parent directories)." + exit 1 +fi +cd "$repo_root" || exit +hooks_dir=".git/hooks" +for path in .githooks/*; do + file="$(basename "$path")" + if [ "$file" = "$script_name" ] || [ ! -f "$path" ]; then continue; fi + ln -sf "$path" "$hooks_dir/$file" + echo "Installed $file to $hooks_dir/$file" +done