summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rwxr-xr-xusr/lib/cgit/filters/about-formatting-edited.sh9
1 files changed, 6 insertions, 3 deletions
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 '<p>$(pwd)</p>'`
+# 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