From 044f2e8a5c5adbb43b41d7390eeb6df6119fe83b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 22 Dec 2020 11:22:49 +0100 Subject: [PATCH] Fix css processor not working without theme dir Processor will now automatically create the necessary directory to put the css stylesheet into if the directory does not exist yet, instead of failing to apply the theme. --- theme_styles | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/theme_styles b/theme_styles index 6980e67..1448c3b 100755 --- a/theme_styles +++ b/theme_styles @@ -54,8 +54,13 @@ save() { fix_placeholders - echo "$newsheet" >"$stylesheet" + if [ ! -f "$stylesheet" ]; then + mkdir -p "$(dirname "$stylesheet")" || dbg_msg $app error "Could not create theme folder for $stylesheet" + dbg_msg $app "Theme folder for $stylesheet did not exist yet so I created it" + fi + echo "$newsheet" >"$stylesheet" + dbg_msg $app "Saved theme to $stylesheet" } fix_placeholders() {