]> git.armaanb.net Git - stagit.git/commitdiff
simplify example.sh, thanks emg for the suggestion!
authorHiltjo Posthuma <hiltjo@codemadness.org>
Thu, 15 Sep 2016 18:44:47 +0000 (20:44 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Thu, 15 Sep 2016 18:44:47 +0000 (20:44 +0200)
example.sh

index e85b50c9d1fac248df28d4b0f91dea4362b75770..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 "^.$" | sort | 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 "^.$" | sort | while read -r dir; do
+for dir in "${reposdir}/"*/; do
+       # strip .git suffix.
        r=$(basename "${dir}")
        d=$(basename "${dir}" ".git")
        printf "%s... " "${d}"