stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

commit cf09c0af0a65f1f284033bf3f69c94820e981214
parent 8968f8cf7ac514463c703e863e953881094ea941
Author: hhvn <dev@hhvn.uk>
Date:   Sat, 22 Jan 2022 11:50:46 +0000

example_post-receive.sh: remove

Diffstat:
Dexample_post-receive.sh | 74--------------------------------------------------------------------------
1 file changed, 0 insertions(+), 74 deletions(-)

diff --git a/example_post-receive.sh b/example_post-receive.sh @@ -1,74 +0,0 @@ -#!/bin/sh -# generic git post-receive hook. -# change the config options below and call this script in your post-receive -# hook or symlink it. -# -# usage: $0 [name] -# -# if name is not set the basename of the current directory is used, -# this is the directory of the repo when called from the post-receive script. - -# NOTE: needs to be set for correct locale (expects UTF-8) otherwise the -# default is LC_CTYPE="POSIX". -export LC_CTYPE="en_US.UTF-8" - -name="$1" -if test "${name}" = ""; then - name=$(basename "$(pwd)") -fi - -# config -# paths must be absolute. -reposdir="/home/src/src" -dir="${reposdir}/${name}" -gopherdir="/home/www/gopher" -stagitdir="/" -destdir="${gopherdir}/${stagitdir}" -cachefile=".gphcache" -# /config - -if ! test -d "${dir}"; then - echo "${dir} does not exist" >&2 - exit 1 -fi -cd "${dir}" || exit 1 - -# detect git push -f -force=0 -while read -r old new ref; do - test "${old}" = "0000000000000000000000000000000000000000" && continue - test "${new}" = "0000000000000000000000000000000000000000" && continue - - hasrevs=$(git rev-list "${old}" "^${new}" | sed 1q) - if test -n "${hasrevs}"; then - force=1 - break - fi -done - -# strip .git suffix. -r=$(basename "${name}") -d=$(basename "${name}" ".git") -printf "[%s] stagit .gph pages... " "${d}" - -mkdir -p "${destdir}/${d}" -cd "${destdir}/${d}" || exit 1 - -# remove commits and ${cachefile} on git push -f, this recreated later on. -if test "${force}" = "1"; then - rm -f "${cachefile}" - rm -rf "commit" -fi - -# remove /'s at the end. -stagitdir=$(printf "%s" "${stagitdir}" | sed 's@[/]*$@@g') - -# make index. -stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ > "${destdir}/index.gph" - -# make pages. -stagit-gopher -b "${stagitdir}/${d}" -c "${cachefile}" "${reposdir}/${r}" - -ln -sf log.gph index.gph - -echo "done"