]> git.armaanb.net Git - stagit.git/blobdiff - example.sh
bump version to 0.5
[stagit.git] / example.sh
index 7727f26fc8479f8af2b20e079b34b522aeb23c74..84ccffd67eb3b5eff092fe05fb691e1f24b22449 100644 (file)
 # - mkdir -p htmldir && cd htmldir
 # - sh example.sh
 
+# path must be absolute.
 reposdir="/var/www/domains/git.codemadness.nl/home/src"
 curdir=$(pwd)
 
 # make index.
-cd "${reposdir}"
-find . -maxdepth 1 -type d | grep -v "^.$" | xargs stagit-index > "${curdir}/index.html"
+stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
 
 # make files per repo.
-cd "${reposdir}"
-find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do
-       d=$(basename "${dir}")
+for dir in "${reposdir}/"*/; do
+       # strip .git suffix.
+       r=$(basename "${dir}")
+       d=$(basename "${dir}" ".git")
        printf "%s... " "${d}"
 
        mkdir -p "${curdir}/${d}"
        cd "${curdir}/${d}"
-       stagit "${reposdir}/${d}"
+       stagit -c ".cache" "${reposdir}/${r}"
 
        # symlinks
        ln -sf log.html index.html