Tweaking stagit-gopher create. - infra - Terraform IoC for my remote (Hetzner) and local (Incus) servers.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 733be92f94dbde14f57aca10a72bb12369b2749b
(DIR) parent 41d71f5056e89db27e24699a494818ce8f15733f
(HTM) Author: Jay Scott <me@jay.scot>
Date: Sat, 4 Feb 2023 16:08:25 +0000
Tweaking stagit-gopher create.
Diffstat:
M ansible/roles/stagit/templates/sta… | 32 ++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
---
(DIR) diff --git a/ansible/roles/stagit/templates/stagit_create.sh.j2 b/ansible/roles/stagit/templates/stagit_create.sh.j2
@@ -10,23 +10,29 @@ stagitdir=$(printf "%s" "${stagitdir}" | sed 's@[/]*$@@g')
rm -rf "{{ stagit_gopher.output_path }}/git/*"
-# make index.
-/usr/local/bin/stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ >"${destdir}/index.gph"
+/usr/local/bin/stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*.git/ >"${destdir}/index.gph"
# make files per repo.
for dir in "${reposdir}/"*/; do
- # strip .git suffix.
- r=$(basename "${dir}")
- d=$(basename "${dir}" ".git")
- printf "%s... " "${d}"
+ # strip .git suffix.
+ r=$(basename "${dir}")
+ d=$(basename "${dir}" ".git")
+ printf "%s... " "${d}"
- mkdir -p "${destdir}/${d}"
- cd "${destdir}/${d}" || continue
- /usr/local/bin/stagit-gopher -b "${stagitdir}/${d}" \
- -u "gopher://jay.scot/1/git/$d/" "${reposdir}/${r}"
+ mkdir -p "${destdir}/${d}"
+ cd "${destdir}/${d}" || continue
- # symlinks
- ln -sf log.gph index.gph
+ if [ "$d" != "pass" ]; then
+ /usr/local/bin/stagit-gopher -b "${stagitdir}/${d}" \
+ -u "gopher://jay.scot/1/git/$d/" "${reposdir}/${r}"
- echo "done"
+ # symlinks
+ ln -sf log.gph index.gph
+
+ echo "done"
+ else
+ echo "skipping"
+ fi
done
+
+