6 [ "$arg" = "--fresh" ] && fresh=true
9 STAGIT=/var/www/git/stagit.out
10 [ ! -f "$STAGIT" ] && STAGIT=stagit
12 STAGIT_INDEX=/var/www/git/stagit-index.out
13 [ ! -f "$STAGIT_INDEX" ] && STAGIT_INDEX=stagit-index
15 for repo in /srv/git/*.git; do
16 repo="$(basename "$repo" | rev | cut -c 5- | rev)"
19 && echo "Deleting HTML for $repo." \
20 && rm -fr "/var/www/git/$repo"
21 mkdir -p "/var/www/git/$repo"
22 cd "/var/www/git/$repo"
24 [ ! -f style.css ] && ln -s ../style.css ./
25 [ ! -f favicon.png ] && ln -s ../favicon.png ./
26 [ ! -f logo.png ] && ln -s ../logo.png ./
27 [ ! -f highlight ] && ln -s ../highlight ./
29 echo "git://git.knutsen.co/$repo" > "/srv/git/$repo.git/url"
31 COMMAND="$STAGIT /srv/git/$repo.git"
36 echo "Generating index.html with \`$STAGIT_INDEX\`."
37 "$STAGIT_INDEX" /srv/git/*.git > /var/www/git/index.html
39 # Correct ownership of the web files.
40 chown git:www-data -R /var/www/git -f
41 chmod g+rw -R /var/www/git -f