diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-07-19 14:11:49 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-07-19 15:28:10 +0200 |
commit | 2537a0b24cac9206f282a071ba5e930aabfc3135 (patch) | |
tree | b49730431721b6f2238b59573bed5113f8181fa1 /support | |
parent | 57f73737903e37af4651e017be4e769dea6cb4d3 (diff) | |
download | gitlab-shell-2537a0b24cac9206f282a071ba5e930aabfc3135.tar.gz |
Remove empty post-receive hook
Diffstat (limited to 'support')
-rwxr-xr-x | support/rewrite-hooks.sh | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/support/rewrite-hooks.sh b/support/rewrite-hooks.sh index 3c4efa4..3c96b6f 100755 --- a/support/rewrite-hooks.sh +++ b/support/rewrite-hooks.sh @@ -6,29 +6,21 @@ home_dir="/home/git" src=${1:-"$home_dir/repositories"} +function create_link_in { + ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update" +} + for dir in `ls "$src/"` do if [ -d "$src/$dir" ]; then if [[ "$dir" =~ ^.*\.git$ ]] then - project_hook="$src/$dir/hooks/post-receive" - gitlab_shell_hook="$home_dir/gitlab-shell/hooks/post-receive" - ln -s -f $gitlab_shell_hook $project_hook - - project_hook="$src/$dir/hooks/update" - gitlab_shell_hook="$home_dir/gitlab-shell/hooks/update" - ln -s -f $gitlab_shell_hook $project_hook + create_link_in "$src/$dir" else for subdir in `ls "$src/$dir/"` do if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then - project_hook="$src/$dir/$subdir/hooks/post-receive" - gitlab_shell_hook="$home_dir/gitlab-shell/hooks/post-receive" - ln -s -f $gitlab_shell_hook $project_hook - - project_hook="$src/$dir/$subdir/hooks/update" - gitlab_shell_hook="$home_dir/gitlab-shell/hooks/update" - ln -s -f $gitlab_shell_hook $project_hook + create_link_in "$src/$dir/$subdir" fi done fi |