diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 16:00:02 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 16:00:02 +0200 |
commit | 38146faa9769f52557fcaa666aaa5873f29a6505 (patch) | |
tree | 278b10cdba1f35795cba62da98b921b87877612f /support/rewrite-hooks.sh | |
parent | 43a55494f15084fe4c6ed5f9e7703a7bb092af86 (diff) | |
download | gitlab-shell-38146faa9769f52557fcaa666aaa5873f29a6505.tar.gz |
support dir
Diffstat (limited to 'support/rewrite-hooks.sh')
-rwxr-xr-x | support/rewrite-hooks.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/support/rewrite-hooks.sh b/support/rewrite-hooks.sh new file mode 100755 index 0000000..b8fd36b --- /dev/null +++ b/support/rewrite-hooks.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +src="/home/git/repositories" + +for dir in `ls "$src/"` +do + if [ -d "$src/$dir" ]; then + + if [ "$dir" = "gitolite-admin.git" ] + then + continue + fi + + if [[ "$dir" =~ ^.*.git$ ]] + then + project_hook="$src/$dir/hooks/post-receive" + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" + + ln -s -f $gitolite_hook $project_hook + else + for subdir in `ls "$src/$dir/"` + do + if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*.git$ ]]; then + project_hook="$src/$dir/$subdir/hooks/post-receive" + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" + + ln -s -f $gitolite_hook $project_hook + fi + done + fi + fi +done |