diff options
fix: make it work?
-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 |