Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
ref: removed duplicated code from execute_build on __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzo committed May 27, 2024
1 parent fe88331 commit 4887ef6
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions sources/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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,
Expand Down

0 comments on commit 4887ef6

Please sign in to comment.