simplify example.sh, thanks emg for the suggestion!
1 files changed, 4 insertions(+), 4 deletions(-) | |||
---|---|---|---|
M | example.sh | +4 | -4 |
1@@ -12,16 +12,16 @@
2 # - mkdir -p htmldir && cd htmldir
3 # - sh example.sh
4
5+# path must be absolute.
6 reposdir="/var/www/domains/git.codemadness.nl/home/src"
7 curdir=$(pwd)
8
9 # make index.
10-cd "${reposdir}"
11-find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index > "${curdir}/index.html"
12+stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
13
14 # make files per repo.
15-cd "${reposdir}"
16-find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
17+for dir in "${reposdir}/"*/; do
18+ # strip .git suffix.
19 r=$(basename "${dir}")
20 d=$(basename "${dir}" ".git")
21 printf "%s... " "${d}"