From 89d94d64cb6baf4fa07985e87b97fc84adf76d76 Mon Sep 17 00:00:00 2001 From: Isabel Date: Mon, 20 May 2024 11:56:58 +0100 Subject: [PATCH] refactor: reduce repeated code (#198) --- build.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/build.py b/build.py index abe81d2e..28c9738a 100755 --- a/build.py +++ b/build.py @@ -590,6 +590,13 @@ def main(): if args.patch: apply_colloid_patches() + if args.zip: + output_format = "zip" + else: + output_format = "dir" + + tweaks = Tweaks(tweaks=args.tweaks) + palette = getattr(PALETTE, args.flavor) accents = [ "rosewater", @@ -612,13 +619,6 @@ def main(): for accent in accents: accent = getattr(palette.colors, accent) - tweaks = Tweaks(tweaks=args.tweaks) - - if args.zip: - output_format = "zip" - else: - output_format = "dir" - ctx = BuildContext( build_root=args.dest, theme_name=args.name, @@ -635,12 +635,6 @@ def main(): logger.info("Done!") else: accent = getattr(palette.colors, args.accent) - tweaks = Tweaks(tweaks=args.tweaks) - - if args.zip: - output_format = "zip" - else: - output_format = "dir" ctx = BuildContext( build_root=args.dest,