From 6af1d58133b9c74402b8178edb85feccd812b828 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 15 Feb 2020 19:08:22 +0100 Subject: [PATCH] Fix importing of stylesheet template Processor was looking for the template relative to calling directory, instead of relative to script file. This fixes it mostly. --- theme_styles | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/theme_styles b/theme_styles index 2caa0eb..6980e67 100755 --- a/theme_styles +++ b/theme_styles @@ -77,7 +77,11 @@ fix_placeholders() { base0E=$(grep -e "\$base0E" "$tfile" | sed -e 's/^$base0E: \(#[[:alnum:]]\+\);$/\1/') base0F=$(grep -e "\$base0F" "$tfile" | sed -e 's/^$base0F: \(#[[:alnum:]]\+\);$/\1/') - newsheet=$(sed -e "s/%base00%/$base00/;s/%base01%/$base01/;s/%base02%/$base02/;s/%base03%/$base03/;s/%base04%/$base04/;s/%base05%/$base05/;s/%base06%/$base06/;s/%base07%/$base07/;s/%base08%/$base08/;s/%base09%/$base09/;s/%base0A%/$base0A/;s/%base0B%/$base0B/;s/%base0C%/$base0C/;s/%base0D%/$base0D/;s/%base0E%/$base0E/;s/%base0F%/$base0F/" "$styletemplate") + # get directory of calling file + local DIR="${BASH_SOURCE%/*}" + if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi + + newsheet=$(sed -e "s/%base00%/$base00/;s/%base01%/$base01/;s/%base02%/$base02/;s/%base03%/$base03/;s/%base04%/$base04/;s/%base05%/$base05/;s/%base06%/$base06/;s/%base07%/$base07/;s/%base08%/$base08/;s/%base09%/$base09/;s/%base0A%/$base0A/;s/%base0B%/$base0B/;s/%base0C%/$base0C/;s/%base0D%/$base0D/;s/%base0E%/$base0E/;s/%base0F%/$base0F/" "$DIR/$styletemplate") } ## Theme includer