Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/jumpstarter-cli/jumpstarter_cli/j.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ async def cli():
async with BlockingPortal() as portal:
with ExitStack() as stack:
async with env_async(portal, stack) as client:
await to_thread.run_sync(lambda: client.cli()(standalone_mode=False))
result = await to_thread.run_sync(lambda: client.cli()(standalone_mode=False))
if isinstance(result, int) and result != 0:
raise BaseExceptionGroup("CLI exit", [click.exceptions.Exit(result)])
except BaseExceptionGroup as eg:
# Handle exceptions wrapped in ExceptionGroup (e.g., from task groups)
if exc := find_exception_in_group(eg, EnvironmentVariableNotSetError):
Expand All @@ -40,6 +42,9 @@ async def cli():
await cli()
finally:
tg.cancel_scope.cancel()
except* click.exceptions.Exit as excgroup:
for exc in leaf_exceptions(excgroup):
sys.exit(exc.exit_code)
except* click.ClickException as excgroup:
for exc in leaf_exceptions(excgroup):
cast(click.ClickException, exc).show()
Expand Down
Loading