diff options
author | 2025-01-05 14:06:03 +0100 | |
---|---|---|
committer | 2025-01-05 14:06:03 +0100 | |
commit | 9eb523beeddc88be51de094e117737797dbdda5d (patch) | |
tree | 6e4c71fa9f1f3ae012c54394886c09000e6b46f7 /image | |
parent | 52ef0a87f842275d183ea8a391df63ff2dd81bd4 (diff) | |
download | cgit-oci-9eb523beeddc88be51de094e117737797dbdda5d.tar.gz cgit-oci-9eb523beeddc88be51de094e117737797dbdda5d.tar.bz2 cgit-oci-9eb523beeddc88be51de094e117737797dbdda5d.tar.lz cgit-oci-9eb523beeddc88be51de094e117737797dbdda5d.zip |
fix: make it work?
Diffstat (limited to 'image')
-rwxr-xr-x | image/prepare-container.sh | 2 | ||||
-rw-r--r-- | image/syntax-highlighting.sh | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/image/prepare-container.sh b/image/prepare-container.sh index fabe6e2..c72df2e 100755 --- a/image/prepare-container.sh +++ b/image/prepare-container.sh @@ -14,7 +14,7 @@ ensureKeyAlgo ecdsa [[ -f /etc/sshd_config ]] && mv /etc/sshd_config /etc/ssh/sshd_config || [[ -f /etc/ssh/sshd_config ]] chmod -w /etc/ssh/sshd_config -echo "$HIGHLIGHT_THEME" > /.highlight-theme +echo -n "$HIGHLIGHT_THEME" > /.highlight-theme # prepare run dir if ! [[ -d "/var/run/sshd" ]]; then diff --git a/image/syntax-highlighting.sh b/image/syntax-highlighting.sh index d119e22..88f59bf 100644 --- a/image/syntax-highlighting.sh +++ b/image/syntax-highlighting.sh @@ -118,8 +118,9 @@ EXTENSION="${BASENAME##*.}" #exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null # This is for version 3 -HIGHLIGHT_THEME="${HIGHLIGHT_THEME:-"$(cat /.highlight-theme)"}" -THEMEOPT=() -if [[ "$HIGHLIGHT_THEME" != "" ]]; then THEMEOPT+=("--style=$HIGHLIGHT_THEME"); fi -exec highlight --force --inline-css "${THEMEOPT[@]}" -f -I -O xhtml -S "$EXTENSION" 2>/dev/null +if [[ "$(cat /.highlight-theme)" != "" ]]; then + exec highlight --force --inline-css "--style=$(cat /.highlight-theme)" -f -I -O xhtml -S "$EXTENSION" 2>/dev/null +else + exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null +fi |