From 14e5da90c3d84cb089e1df4d7a0ac7a34a0fbeba Mon Sep 17 00:00:00 2001
From: Igor Wiedler <igor@wiedler.ch>
Date: Sat, 26 Jun 2010 13:38:50 +0200
Subject: [PATCH] [task/git-tools] add install and uninstall scripts for hooks

PHPBB3-9769
---
 git-tools/hooks/install   | 17 +++++++++++++++++
 git-tools/hooks/uninstall | 16 ++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100755 git-tools/hooks/install
 create mode 100755 git-tools/hooks/uninstall

diff --git a/git-tools/hooks/install b/git-tools/hooks/install
new file mode 100755
index 0000000000..a42c55a769
--- /dev/null
+++ b/git-tools/hooks/install
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Script to install the git hooks
+# by symlinking them into the .git/hooks directory
+#
+# Usage (from within git-tools/hooks):
+# ./install
+
+dir=$(dirname $0)
+
+for file in $(ls $dir)
+do
+	if [ $file != "install" ] && [ $file != "uninstall" ]
+	then
+		ln -s "../../git-tools/hooks/$file" "$dir/../../.git/hooks/$file"
+	fi
+done
diff --git a/git-tools/hooks/uninstall b/git-tools/hooks/uninstall
new file mode 100755
index 0000000000..1b3b7fd2c9
--- /dev/null
+++ b/git-tools/hooks/uninstall
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Script to uninstall the git hooks
+#
+# Usage (from within git-tools/hooks):
+# ./uninstall
+
+dir=$(dirname $0)
+
+for file in $(ls $dir)
+do
+	if [ $file != "install" ] && [ $file != "uninstall" ]
+	then
+		rm -f "$dir/../../.git/hooks/$file"
+	fi
+done