summaryrefslogtreecommitdiff
path: root/gen_conf.sh
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-27 13:48:48 -0400
committerDeterminant <[email protected]>2018-07-27 13:48:48 -0400
commit217d03a25d583fce1b565af061330f3be35d04fe (patch)
treed2af533ead5ecb0e22a92d488879ca812928dbb3 /gen_conf.sh
parent9c00927ca7fdbc29f2a15cfdfe9e054cd94146a0 (diff)
downloadcgit-dark-217d03a25d583fce1b565af061330f3be35d04fe.tar.gz
cgit-dark-217d03a25d583fce1b565af061330f3be35d04fe.tar.bz2
cgit-dark-217d03a25d583fce1b565af061330f3be35d04fe.zip
...
Diffstat (limited to 'gen_conf.sh')
-rwxr-xr-xgen_conf.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/gen_conf.sh b/gen_conf.sh
index cea5592..db83988 100755
--- a/gen_conf.sh
+++ b/gen_conf.sh
@@ -4,12 +4,20 @@ if [[ ! "$#" -eq 1 ]]; then
echo "please specify the virtual root, e.g. /git/"
exit 1
fi
-VIRT_ROOT=${1%/}
+
+function remove_slashes {
+ x="$1"
+ case "$x" in *[!/]*/) x="${x%"${x##*[!/]}"}";; esac
+ echo "$x"
+}
+
+VIRT_ROOT=$(remove_slashes "${1%/}")
+echo $VIRT_ROOT
cat > theme.cgitrc << EOF
css=
logo=
virtual-root=$VIRT_ROOT
-header=${BASE_DIR}/header.html
+head-include=${BASE_DIR}/head.html
footer=${BASE_DIR}/footer.html
source-filter=${BASE_DIR}/syntax-highlighting.py
about-filter=${BASE_DIR}/about-formatting.sh
@@ -26,3 +34,5 @@ location $VIRT_ROOT/assets {
disable_symlinks off;
}
EOF
+
+sed "s=%VIRT_ROOT%=$VIRT_ROOT=g" head.html.template > head.html