example scripts: fix sed expression, dont interpret as variable - stagit-gopher - A git gopher frontend. (mirror)
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
Log
Files
Refs
Tags
README
LICENSE
---
commit 64de96fd44c906f17fb5124ed11c89d9b2fcb08f
parent b831ce30c99b8d278f8917cf5c56ea5fa4ccf8a0
Author: Hiltjo Posthuma 
Date:   Sun, 30 Jul 2017 17:35:33 +0200

example scripts: fix sed expression, dont interpret as variable

Diffstat:
  M example_create.sh                   |       3 +++
  M example_post-receive.sh             |       2 +-

2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/example_create.sh b/example_create.sh
@@ -17,6 +17,9 @@ gopherdir="/var/gopher"
 stagitdir="/scm"
 destdir="${gopherdir}/${stagitdir}"
 
+# remove /'s at the end.
+stagitdir=$(printf "%s" "${stagitdir}" | sed 's@[/]*$@@g')
+
 # make index.
 stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ > "${destdir}/index.gph"
 
diff --git a/example_post-receive.sh b/example_post-receive.sh
@@ -54,7 +54,7 @@ if test "${force}" = "1"; then
 fi
 
 # remove /'s at the end.
-stagitdir=$(printf "%s" "${stagitdir}" | sed "s@[/]*$@@g")
+stagitdir=$(printf "%s" "${stagitdir}" | sed 's@[/]*$@@g')
 
 # make index.
 stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ > "${destdir}/index.gph"