mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
build: add Docker builds
Co-authored-by: Jakub Stastka <jakub@stastka.org>
This commit is contained in:
co-authored by
Jakub Stastka
parent
7426924170
commit
696fad78b3
@@ -66,6 +66,21 @@ def list_players(roster: Roster, file: T.Optional[T.Any] = None) -> None:
|
||||
print(f"{i}. {player.name}", file=file)
|
||||
|
||||
|
||||
def bootstrap_first_run(roster: Roster, args: argparse.Namespace) -> None:
|
||||
if roster.players or args.list_saves or args.load_save:
|
||||
return
|
||||
|
||||
print("No saved characters found. Starting first-run character creation.")
|
||||
ui = BasicUserInterface(roster, None, args)
|
||||
while not roster.players:
|
||||
player = ui.create_player(auto_play=False)
|
||||
if player:
|
||||
return
|
||||
if not ui.confirm("No character created. Do you want to try again?"):
|
||||
print("A character is required for first run.", file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
roster = Roster.load(SAVE_PATH)
|
||||
@@ -83,6 +98,8 @@ def main() -> None:
|
||||
list_players(roster, file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
bootstrap_first_run(roster, args)
|
||||
|
||||
try:
|
||||
ui = args.ui(roster, player, args)
|
||||
ui.run()
|
||||
|
||||
Reference in New Issue
Block a user