iimprove example, remove sort hack - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70 hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70 1Log /scm/stagit-gopher/log.gph bitreich.org 70 1Files /scm/stagit-gopher/files.gph bitreich.org 70 1Refs /scm/stagit-gopher/refs.gph bitreich.org 70 1Tags /scm/stagit-gopher/tag bitreich.org 70 1README /scm/stagit-gopher/file/README.gph bitreich.org 70 1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit bc7515e2dcd820b1b5b73f4e6e61e813ae01959f /scm/stagit-gopher/commit/bc7515e2dcd820b1b5b73f4e6e61e813ae01959f.gph bitreich.org 70 1parent a524ca1b3d88990212f6521bec1b51d09c4b41fb /scm/stagit-gopher/commit/a524ca1b3d88990212f6521bec1b51d09c4b41fb.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Fri, 29 Apr 2016 16:38:48 +0200 Err bitreich.org 70 i Err bitreich.org 70 iimprove example, remove sort hack Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M example.sh | 21 ++++----------------- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 4 insertions(+), 17 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/example.sh b/example.sh /scm/stagit-gopher/file/example.sh.gph bitreich.org 70 i@@ -17,26 +17,13 @@ curdir=$(pwd) Err bitreich.org 70 i Err bitreich.org 70 i # make index. Err bitreich.org 70 i cd "${reposdir}" Err bitreich.org 70 i-find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index | Err bitreich.org 70 i- sed 's@Last commit@Last commit@g' | \ Err bitreich.org 70 i- sed 's@Name@Name@g' > "${curdir}/index.html" Err bitreich.org 70 i- Err bitreich.org 70 i-# make index (sort by last commit author time). Err bitreich.org 70 i-find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do Err bitreich.org 70 i- d=$(basename "${dir}") Err bitreich.org 70 i- cd "${reposdir}/${d}" Err bitreich.org 70 i- timestamp=$(git show -s --pretty="format:%at" || true) Err bitreich.org 70 i- Err bitreich.org 70 i- printf "%d %s\n" "${timestamp}" "${d}" Err bitreich.org 70 i-done | sort -n -k 1 | cut -f 2- -d ' ' | xargs stagit-index | \ Err bitreich.org 70 i- sed 's@Last commit@Last commit@g' | \ Err bitreich.org 70 i- sed 's@Name@Name@g' > "${curdir}/index-time.html" Err bitreich.org 70 i+find . -maxdepth 1 -type d | grep -v "^.$" | xargs stagit-index > "${curdir}/index.html" Err bitreich.org 70 i Err bitreich.org 70 i # make files per repo. Err bitreich.org 70 i cd "${reposdir}" Err bitreich.org 70 i-find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do Err bitreich.org 70 i+find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do Err bitreich.org 70 i d=$(basename "${dir}") Err bitreich.org 70 i- printf "%s..." "${d}" Err bitreich.org 70 i+ printf "%s... " "${d}" Err bitreich.org 70 i Err bitreich.org 70 i mkdir -p "${curdir}/${d}" Err bitreich.org 70 i cd "${curdir}/${d}" Err bitreich.org 70 i@@ -48,5 +35,5 @@ find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do Err bitreich.org 70 i ln -sf ../logo.png logo.png Err bitreich.org 70 i ln -sf ../favicon.png favicon.png Err bitreich.org 70 i Err bitreich.org 70 i- printf " done\n" Err bitreich.org 70 i+ printf "done\n" Err bitreich.org 70 i done Err bitreich.org 70 .