Feat: improve script
This commit is contained in:
@@ -31,9 +31,20 @@ from rich.table import Table
|
||||
from rich.text import Text
|
||||
|
||||
import questionary
|
||||
from questionary import Style as QStyle
|
||||
|
||||
console = Console()
|
||||
|
||||
PROMPT_STYLE = QStyle([
|
||||
("qmark", "fg:cyan bold"),
|
||||
("question", "fg:white bold"),
|
||||
("pointer", "fg:cyan bold"),
|
||||
("highlighted", "fg:cyan bold"),
|
||||
("selected", "fg:green"),
|
||||
("instruction", "fg:white"),
|
||||
("text", "fg:white"),
|
||||
])
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Build progress tracking (shared between threads)
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -727,7 +738,7 @@ def prompt_platforms(platforms: list[Platform], alias_map: dict[str, Platform])
|
||||
questionary.Choice("All platforms", value="all", checked=True),
|
||||
*[questionary.Choice(p.label, value=p.alias) for p in platforms],
|
||||
]
|
||||
selected = questionary.checkbox("Select platforms:", choices=choices).ask()
|
||||
selected = questionary.checkbox("Select platforms:", choices=choices, style=PROMPT_STYLE).ask()
|
||||
if selected is None:
|
||||
sys.exit(0)
|
||||
if "all" in selected or not selected:
|
||||
@@ -741,7 +752,7 @@ def prompt_targets() -> BuildConfig:
|
||||
questionary.Choice("cagire-desktop", value="desktop", checked=True),
|
||||
questionary.Choice("cagire-plugins (CLAP/VST3)", value="plugins", checked=True),
|
||||
]
|
||||
selected = questionary.checkbox("Select targets:", choices=choices).ask()
|
||||
selected = questionary.checkbox("Select targets:", choices=choices, style=PROMPT_STYLE).ask()
|
||||
if selected is None:
|
||||
sys.exit(0)
|
||||
if not selected:
|
||||
@@ -766,7 +777,7 @@ def confirm_summary(platforms: list[Platform], config: BuildConfig) -> None:
|
||||
console.print(" cagire-plugins")
|
||||
console.print()
|
||||
|
||||
if not questionary.confirm("Proceed?", default=True).ask():
|
||||
if not questionary.confirm("Proceed?", default=True, style=PROMPT_STYLE).ask():
|
||||
console.print("[dim]Aborted.[/]")
|
||||
sys.exit(0)
|
||||
|
||||
@@ -946,4 +957,8 @@ def main() -> None:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
console.print("\n[yellow]Interrupted.[/] Partial artifacts may remain in releases/.")
|
||||
sys.exit(130)
|
||||
|
||||
Reference in New Issue
Block a user