refactor: reduce repeated code (#198)
This commit is contained in:
20
build.py
20
build.py
@@ -590,6 +590,13 @@ def main():
|
|||||||
if args.patch:
|
if args.patch:
|
||||||
apply_colloid_patches()
|
apply_colloid_patches()
|
||||||
|
|
||||||
|
if args.zip:
|
||||||
|
output_format = "zip"
|
||||||
|
else:
|
||||||
|
output_format = "dir"
|
||||||
|
|
||||||
|
tweaks = Tweaks(tweaks=args.tweaks)
|
||||||
|
|
||||||
palette = getattr(PALETTE, args.flavor)
|
palette = getattr(PALETTE, args.flavor)
|
||||||
accents = [
|
accents = [
|
||||||
"rosewater",
|
"rosewater",
|
||||||
@@ -612,13 +619,6 @@ def main():
|
|||||||
for accent in accents:
|
for accent in accents:
|
||||||
accent = getattr(palette.colors, accent)
|
accent = getattr(palette.colors, accent)
|
||||||
|
|
||||||
tweaks = Tweaks(tweaks=args.tweaks)
|
|
||||||
|
|
||||||
if args.zip:
|
|
||||||
output_format = "zip"
|
|
||||||
else:
|
|
||||||
output_format = "dir"
|
|
||||||
|
|
||||||
ctx = BuildContext(
|
ctx = BuildContext(
|
||||||
build_root=args.dest,
|
build_root=args.dest,
|
||||||
theme_name=args.name,
|
theme_name=args.name,
|
||||||
@@ -635,12 +635,6 @@ def main():
|
|||||||
logger.info("Done!")
|
logger.info("Done!")
|
||||||
else:
|
else:
|
||||||
accent = getattr(palette.colors, args.accent)
|
accent = getattr(palette.colors, args.accent)
|
||||||
tweaks = Tweaks(tweaks=args.tweaks)
|
|
||||||
|
|
||||||
if args.zip:
|
|
||||||
output_format = "zip"
|
|
||||||
else:
|
|
||||||
output_format = "dir"
|
|
||||||
|
|
||||||
ctx = BuildContext(
|
ctx = BuildContext(
|
||||||
build_root=args.dest,
|
build_root=args.dest,
|
||||||
|
Reference in New Issue
Block a user