summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall-repos8
1 files changed, 6 insertions, 2 deletions
diff --git a/install-repos b/install-repos
index 82518f2..148ae9d 100755
--- a/install-repos
+++ b/install-repos
@@ -1,7 +1,8 @@
#!/bin/sh -eu
set -eu
-REPOS="/data/git/*.git"
+DIR="/data/git"
+REPOS="$DIR/*.git"
HOOKS="pre-receive"
dir=`dirname $0`
BASE=`realpath $dir`
@@ -10,8 +11,11 @@ for hook in $HOOKS; do
for git in $REPOS; do
if [ -d "$git" ]; then
cd $git
- echo `basename $git`
+ name=`basename $git`
+ simple=${name%.git}
+ echo $name
chown -R www:www .
+ ln -sf $git $DIR/$simple
find . -type f -print0 | xargs -0 chmod 660
find . -type d -print0 | xargs -0 chmod 770
ln -sf $BASE/$hook hooks/$hook