stagit

example.sh: fix: remove error mode, would stop if a dir was invalid

mkdir -p makes the directory always, so no need to check.

Hiltjo Posthuma contact@arjunchoudhary.com

commit: 74a1bb8 parent: 618214c
1 files changed, 5 insertions(+), 9 deletions(-)
Mexample.sh+5-9
M · example.sh +5, -9
 1@@ -12,8 +12,6 @@
 2 # - mkdir -p htmldir && cd htmldir
 3 # - sh example.sh
 4 
 5-set -e
 6-
 7 reposdir="/var/www/domains/git.codemadness.nl/home/src"
 8 curdir=$(pwd)
 9 
10@@ -34,23 +32,21 @@ done | sort -n -k 1 | cut -f 2- -d ' ' | xargs stagit-index | \
11 	sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit</a></td>@g' | \
12 	sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${curdir}/index-time.html"
13 
14-cd "${reposdir}"
15-
16 # make files per repo.
17+cd "${reposdir}"
18 find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
19 	d=$(basename "${dir}")
20 	printf "%s..." "${d}"
21-	cd "${curdir}"
22 
23-	test -d "${d}" || mkdir -p "${d}"
24-	cd "${d}"
25+	mkdir -p "${curdir}/${d}"
26+	cd "${curdir}/${d}"
27 	stagit "${reposdir}/${d}"
28 
29-	printf " done\n"
30-
31 	# symlinks
32 	ln -sf log.html index.html
33 	ln -sf ../style.css style.css
34 	ln -sf ../logo.png logo.png
35 	ln -sf ../favicon.png favicon.png
36+
37+	printf " done\n"
38 done