]> git.armaanb.net Git - stagit.git/blob - repo-gen.sh
Initial changes.
[stagit.git] / repo-gen.sh
1 #!/bin/sh
2
3 fresh=false
4
5 for arg in "$@"; do
6         [ "$arg" = "--fresh" ] && fresh=true
7 done
8
9 for repo in /srv/git/*.git; do
10         repo="$(basename "$repo" | cut -f 1 -d '.')"
11         
12         [ "$fresh" = true ] \
13                 && echo "Deleting HTML for $repo." \
14                 && rm -fr "/var/www/git/$repo"
15         mkdir -p "/var/www/git/$repo"
16         cd "/var/www/git/$repo"
17         
18         [ ! -f style.css ]   && ln -s ../style.css ./
19         [ ! -f favicon.png ] && ln -s ../favicon.png ./
20         [ ! -f logo.png ]    && ln -s ../logo.png ./
21
22         echo "git://git.knutsen.co/$repo" > "/srv/git/$repo.git/url"
23
24         stagit "/srv/git/$repo.git"
25 done
26
27 stagit-index /srv/git/*.git > /var/www/git/index.html