]> git.armaanb.net Git - stagit.git/blobdiff - example.sh
fix error in "code cleanup" commit 9328d2690e118127bcaa5cf9f665d8e7711f7a03
[stagit.git] / example.sh
index 385283d272c9b889ce8bdf484a29e22a0bfe6db4..6f4ea2dd294bd7be48180c3f765099d0bab1d0cb 100644 (file)
 # - mkdir -p htmldir && cd htmldir
 # - sh example.sh
 
-set -e
-
 reposdir="/var/www/domains/git.codemadness.nl/home/src"
 curdir=$(pwd)
 
 # make index.
 cd "${reposdir}"
-find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index |
-        sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit</a></td>@g' | \
-        sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${curdir}/index.html"
-
-# make index (sort by last commit author time).
-find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do
-       d=$(basename "${dir}")
-       cd "${reposdir}/${d}"
-       timestamp=$(git show -s --pretty="format:%at" || true)
-
-       printf "%d %s\n" "${timestamp}" "${d}"
-done | sort -n -k 1 | cut -f 2- -d ' ' | xargs stagit-index | \
-       sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit</a></td>@g' | \
-       sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${curdir}/index-time.html"
+find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index > "${curdir}/index.html"
 
 # make files per repo.
+cd "${reposdir}"
 find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
        d=$(basename "${dir}")
+       printf "%s... " "${d}"
 
-       printf "%s..." "${d}"
-       cd "${curdir}"
-
-       test -d "${d}" || mkdir -p "${d}"
-       cd "${d}"
-       stagit "${reposdir}/${d}"
-
-       printf " done\n"
+       mkdir -p "${curdir}/${d}"
+       cd "${curdir}/${d}"
+       stagit -c ".cache" "${reposdir}/${d}"
 
        # symlinks
        ln -sf log.html index.html
        ln -sf ../style.css style.css
        ln -sf ../logo.png logo.png
        ln -sf ../favicon.png favicon.png
+
+       printf "done\n"
 done