mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-17 16:44:59 -04:00
⚡ Command line arguments added
This commit is contained in:
parent
7c35cc1a57
commit
7cf892265c
1 changed files with 52 additions and 6 deletions
|
@ -1,13 +1,59 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from applbuild.generator import xbuild, wbuild
|
||||
from applbuild.generator import build, wbuild, xbuild
|
||||
|
||||
bitmaps_dir = Path("../pngs")
|
||||
x_out_dir = Path("../themes") / "macOSBigSur"
|
||||
win_out_dir = Path("../themes") / "macOSBigSur-Windows"
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="apple_builder",
|
||||
description="'macOSBigSur' cursor build python script.",
|
||||
)
|
||||
|
||||
xbuild(bitmaps_dir, x_out_dir)
|
||||
wbuild(bitmaps_dir,win_out_dir)
|
||||
# Positional Args.
|
||||
parser.add_argument(
|
||||
"platform",
|
||||
choices=("windows", "unix", "all"),
|
||||
default="all",
|
||||
const="all",
|
||||
nargs="?",
|
||||
help="Set package type, Which you want to build. (default: '%(default)s')",
|
||||
)
|
||||
|
||||
|
||||
# Optional Args.
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--png-dir",
|
||||
dest="png_dir",
|
||||
metavar="PNG",
|
||||
type=str,
|
||||
default="../pngs",
|
||||
help="To change pngs directory. (default: %(default)s)",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--out-dir",
|
||||
dest="out_dir",
|
||||
metavar="OUT",
|
||||
type=str,
|
||||
default="../themes",
|
||||
help="To change output directory. (default: %(default)s)",
|
||||
)
|
||||
|
||||
|
||||
# Preparing build
|
||||
args = parser.parse_args()
|
||||
|
||||
bitmaps_dir = Path(args.png_dir)
|
||||
x_out_dir = Path(args.out_dir) / "macOSBigSur"
|
||||
win_out_dir = Path(args.out_dir) / "macOSBigSur-Windows"
|
||||
|
||||
if args.platform == "unix":
|
||||
xbuild(bitmaps_dir, x_out_dir)
|
||||
elif args.platform == "windows":
|
||||
wbuild(bitmaps_dir, win_out_dir)
|
||||
else:
|
||||
build(bitmaps_dir, x_out_dir, win_out_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue