From 3423747f3331fa457b421be91caff397cd3d0d90 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 22 Nov 2022 20:59:49 -0500 Subject: [PATCH] Remove data/_theme.scss from git history - Remove data/_theme.scss from git history, to prevent accidental overwrites/commits - Add a step to the configuration wizard to create a blank file if one doesn't exist - Move the file existence check in compile-scss to before favicon building (as it errors if the file is missing) Fixes https://todo.sr.ht/~tsileo/microblog.pub/67 --- data/_theme.scss | 1 - scripts/config_wizard.py | 4 ++++ tasks.py | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 data/_theme.scss diff --git a/data/_theme.scss b/data/_theme.scss deleted file mode 100644 index 9fc2396..0000000 --- a/data/_theme.scss +++ /dev/null @@ -1 +0,0 @@ -// override vars for theming here diff --git a/scripts/config_wizard.py b/scripts/config_wizard.py index 912d726..9fcd3ef 100644 --- a/scripts/config_wizard.py +++ b/scripts/config_wizard.py @@ -25,6 +25,10 @@ def _(event): def main() -> None: + theme_file = Path("data/_theme.scss") + if not theme_file.exists(): + theme_file.write_text("// override vars for theming here") + print("Welcome to microblog.pub setup wizard\n") print("Generating key...") if _KEY_PATH.exists(): diff --git a/tasks.py b/tasks.py index 2dd57bf..b084885 100644 --- a/tasks.py +++ b/tasks.py @@ -46,16 +46,16 @@ def compile_scss(ctx, watch=False): # type: (Context, bool) -> None from app.utils.favicon import build_favicon + theme_file = Path("data/_theme.scss") + if not theme_file.exists(): + theme_file.write_text("// override vars for theming here") + favicon_file = Path("data/favicon.ico") if not favicon_file.exists(): build_favicon() else: shutil.copy2(favicon_file, "app/static/favicon.ico") - theme_file = Path("data/_theme.scss") - if not theme_file.exists(): - theme_file.write_text("// override vars for theming here") - if watch: run("boussole watch", echo=True) else: