From 4887ef676b7070374331bcdcd2a3fbcb27db041d Mon Sep 17 00:00:00 2001 From: ruzo Date: Mon, 27 May 2024 02:57:07 +0300 Subject: [PATCH] ref: removed duplicated code from execute_build on __init__.py --- sources/build/__init__.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/sources/build/__init__.py b/sources/build/__init__.py index b78e18f9..b050cf0a 100644 --- a/sources/build/__init__.py +++ b/sources/build/__init__.py @@ -10,25 +10,20 @@ def execute_build(git_root: str, args: Namespace): + colloid_dir = f"{git_root}/sources/colloid" colloid_tmp_dir = f"{git_root}/.tmp/colloid-tmp-{args.flavor}" - shutil.copytree(colloid_dir, colloid_tmp_dir) - src_dir = colloid_tmp_dir + "/src" + tweaks = Tweaks(tweaks=args.tweaks) + palette = getattr(PALETTE, args.flavor) + output_format = "zip" if args.zip else "dir" + if args.patch: patch_dir = git_root + "/sources/patches/colloid/" apply_colloid_patches(colloid_tmp_dir, patch_dir) - if args.zip: - output_format = "zip" - else: - output_format = "dir" - - tweaks = Tweaks(tweaks=args.tweaks) - palette = getattr(PALETTE, args.flavor) - accents = args.accents if args.all_accents: accents = [ @@ -51,13 +46,6 @@ def execute_build(git_root: str, args: Namespace): 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( output_root=args.dest, colloid_src_dir=src_dir,