summaryrefslogtreecommitdiff
path: root/support/rewrite-hooks.sh
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2013-02-08 04:10:01 +0400
committerAndrey Kumanyaev <me@zzet.org>2013-02-08 04:10:01 +0400
commit3278adf1e76be62dcc1dd509cff309b297b807c0 (patch)
treecfb0e18686442445e3eec0d2c8dbc6c28805d6e5 /support/rewrite-hooks.sh
parent58231f31711666c04a7c960f5bc8671dce56479a (diff)
downloadgitlab-shell-3278adf1e76be62dcc1dd509cff309b297b807c0.tar.gz
simple DRY (if non-usual installation)
Diffstat (limited to 'support/rewrite-hooks.sh')
-rwxr-xr-xsupport/rewrite-hooks.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/support/rewrite-hooks.sh b/support/rewrite-hooks.sh
index b328f3e..6de4dfc 100755
--- a/support/rewrite-hooks.sh
+++ b/support/rewrite-hooks.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-src="/home/git/repositories"
+home_dir="/home/git"
+src="$home_dir/repositories"
for dir in `ls "$src/"`
do
@@ -14,22 +15,22 @@ do
if [[ "$dir" =~ ^.*\.git$ ]]
then
project_hook="$src/$dir/hooks/post-receive"
- gitolite_hook="/home/git/gitlab-shell/hooks/post-receive"
+ gitolite_hook="$home_dir/gitlab-shell/hooks/post-receive"
ln -s -f $gitolite_hook $project_hook
project_hook="$src/$dir/hooks/update"
- gitolite_hook="/home/git/gitlab-shell/hooks/update"
+ gitolite_hook="$home_dir/gitlab-shell/hooks/update"
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/gitlab-shell/hooks/post-receive"
+ gitolite_hook="$home_dir/gitlab-shell/hooks/post-receive"
ln -s -f $gitolite_hook $project_hook
project_hook="$src/$dir/$subdir/hooks/update"
- gitolite_hook="/home/git/gitlab-shell/hooks/update"
+ gitolite_hook="$home_dir/gitlab-shell/hooks/update"
ln -s -f $gitolite_hook $project_hook
fi
done