]> git.armaanb.net Git - stagit.git/blobdiff - repo-gen.sh
Fix highlight script location.
[stagit.git] / repo-gen.sh
index f74e02f0b416ef2e41a7b024ca9e698eb53c2d01..c2a25a81c29ad9cde5b5523cb93847af608e2866 100755 (executable)
@@ -6,14 +6,14 @@ for arg in "$@"; do
        [ "$arg" = "--fresh" ] && fresh=true
 done
 
-STAGIT=/var/www/git/stagit
+STAGIT=/var/www/git/stagit.out
 [ ! -f "$STAGIT" ] && STAGIT=stagit
 
-STAGIT_INDEX=/var/www/git/stagit-index
+STAGIT_INDEX=/var/www/git/stagit-index.out
 [ ! -f "$STAGIT_INDEX" ] && STAGIT_INDEX=stagit-index
 
 for repo in /srv/git/*.git; do
-       repo="$(basename "$repo" | cut -f 1 -d '.')"
+       repo="$(basename "$repo" | rev | cut -c 5- | rev)"
 
        [ "$fresh" = true ] \
                && echo "Deleting HTML for $repo." \
@@ -24,10 +24,18 @@ for repo in /srv/git/*.git; do
        [ ! -f style.css ]   && ln -s ../style.css ./
        [ ! -f favicon.png ] && ln -s ../favicon.png ./
        [ ! -f logo.png ]    && ln -s ../logo.png ./
+       [ ! -f highlight ]   && ln -s ../highlight ./
 
        echo "git://git.knutsen.co/$repo" > "/srv/git/$repo.git/url"
 
-       "$STAGIT" "/srv/git/$repo.git"
+       COMMAND="$STAGIT /srv/git/$repo.git"
+       echo "$COMMAND"
+       $COMMAND
 done
 
+echo "Generating index.html with \`$STAGIT_INDEX\`."
 "$STAGIT_INDEX" /srv/git/*.git > /var/www/git/index.html
+
+# Correct ownership of the web files.
+chown git:www-data -R /var/www/git -f
+chmod         g+rw -R /var/www/git -f