Arrange prefix path handling in example.sh - stagit-gopher - A git gopher frontend. (mirror)
HTML git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 60eefdd22bc7d6b1a48b00906eb1d94e7322d9ea
DIR parent 5012d76a0494d9afa62840159e2a58e33af2c814
HTML Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 1 Jul 2017 14:45:34 +0200
Arrange prefix path handling in example.sh
This makes it easier to handle the gopher dir and it's relative
stagit-gopher path.
Diffstat:
M example.sh | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
DIR diff --git a/example.sh b/example.sh
@@ -11,11 +11,13 @@
# - sh example.sh
# path must be absolute.
-reposdir="/var/www/domains/git.codemadness.nl/home/src"
-curdir=$(pwd)
+reposdir="/var/scm/git"
+gopherdir="/var/gopher"
+stagitdir="/scm"
+destdir="${gopherdir}/${stagitdir}"
# make index.
-stagit-gopher-index "${reposdir}/"*/ > "${curdir}/index.gph"
+stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ > "${destdir}/index.gph"
# make files per repo.
for dir in "${reposdir}/"*/; do
@@ -24,9 +26,9 @@ for dir in "${reposdir}/"*/; do
d=$(basename "${dir}" ".git")
printf "%s... " "${d}"
- mkdir -p "${curdir}/${d}"
- cd "${curdir}/${d}"
- stagit-gopher -b "/${d}" -c ".cache" "${reposdir}/${r}"
+ mkdir -p "${destdir}/${d}"
+ cd "${destdir}/${d}"
+ stagit-gopher -b "${stagitdir}/${d}" -c ".cache" "${reposdir}/${r}"
# symlinks
ln -sf log.gph index.gph