From 05c13b57cb36039ce01ba8524986b326a70b39e3 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 26 Feb 2024 08:39:17 +0000 Subject: fix: wrong script location In about-formatting-edited.sh, `pwd` when cgit run this script is /, can be tested by `cat '

$(pwd)

'` so need to get those scripts location via $0, $0 is /usr/lib/cgit/filters/about-formatting-edited.sh --- usr/lib/cgit/filters/about-formatting-edited.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr') diff --git a/usr/lib/cgit/filters/about-formatting-edited.sh b/usr/lib/cgit/filters/about-formatting-edited.sh index 2622abaa..e919e54d 100755 --- a/usr/lib/cgit/filters/about-formatting-edited.sh +++ b/usr/lib/cgit/filters/about-formatting-edited.sh @@ -17,10 +17,13 @@ # CGIT_REPO_SECTION ( = section setting ) # CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) +# note `pwd` when cgit run this script is /, can be tested by `cat '

$(pwd)

'` +# so need to get those scripts location via $0, $0 is /usr/lib/cgit/filters/about-formatting-edited.sh +dir="$(dirname "$0")/html-converters/" case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in *.markdown|*.mdown|*.md|*.mkd) exec cmark;; -# *.rst) exec ./html-converters/rst2html;; - *.[1-9]) exec ./html-converters/man2html;; +# *.rst) exec "$dir/rst2html";; + *.[1-9]) exec "$dir/man2html";; *.htm|*.html) exec cat;; - *.txt|*) exec ./html-converters/txt2html;; + *.txt|*) exec "$dir/txt2html";; esac -- cgit v1.2.3-70-g09d2