improve example, remove sort hack - stagit-gopher - A git gopher frontend. (mir… | |
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2h… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit bc7515e2dcd820b1b5b73f4e6e61e813ae01959f | |
parent a524ca1b3d88990212f6521bec1b51d09c4b41fb | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Fri, 29 Apr 2016 16:38:48 +0200 | |
improve example, remove sort hack | |
Diffstat: | |
M example.sh | 21 ++++----------------- | |
1 file changed, 4 insertions(+), 17 deletions(-) | |
--- | |
diff --git a/example.sh b/example.sh | |
@@ -17,26 +17,13 @@ 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<… | |
- sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${cu… | |
- | |
-# 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<… | |
- sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${cu… | |
+find . -maxdepth 1 -type d | grep -v "^.$" | xargs stagit-index > "${curdir}/i… | |
# make files per repo. | |
cd "${reposdir}" | |
-find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do | |
+find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do | |
d=$(basename "${dir}") | |
- printf "%s..." "${d}" | |
+ printf "%s... " "${d}" | |
mkdir -p "${curdir}/${d}" | |
cd "${curdir}/${d}" | |
@@ -48,5 +35,5 @@ find . -maxdepth 1 -type d | grep -v "^.$" | sort | while rea… | |
ln -sf ../logo.png logo.png | |
ln -sf ../favicon.png favicon.png | |
- printf " done\n" | |
+ printf "done\n" | |
done |