summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie <root@dev.ws.local>2009-10-29 17:58:37 -0600
committerCharlie <root@dev.ws.local>2009-10-29 17:58:37 -0600
commit42ec9addb72f9a1c3f0b37e66445fa0c251951b9 (patch)
tree3e45b2b81caab8ce3030a14e2fd97f2dbc24acde
parent8e6e01053eee06ac33277f5665a746f9c42f5e39 (diff)
Make simple links for git access without the .git extension
-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