From 672ff1238a6c77ba478523441a9b5cd02cf60e1b Mon Sep 17 00:00:00 2001 From: Jan Strohbeck Date: Thu, 28 Mar 2019 10:49:03 +0100 Subject: [PATCH] [ADD] Script to recursively remove git hooks from a repository. --- remove_hooks.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 remove_hooks.sh diff --git a/remove_hooks.sh b/remove_hooks.sh new file mode 100755 index 0000000..100589a --- /dev/null +++ b/remove_hooks.sh @@ -0,0 +1,9 @@ +#!/bin/bash +if [ $# -ne 1 ]; then + echo "Usage: remove_hooks.sh /path/to/repository" >&2 + exit 1 +fi +cd $1 || exit 2 +find . -name ".git" -type d | xargs -n1 -I _DIR_ find _DIR_ -name "*.config.yaml" -exec rm {} \; +find . -name ".git" -type d | xargs -n1 -I _DIR_ find _DIR_ -name "pre-commit" -exec rm {} \; +find . -name "run_hooks" -exec rm {} \;