Skip to content

Commit 4ddb15d

Browse files
committed
✨ Add confirmation option when deploying the first time
1 parent e79be2b commit 4ddb15d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/fastapi_cloud_cli/commands/deploy.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,25 @@ def _configure_app(toolkit: RichToolkit, path_to_deploy: Path) -> AppConfig:
322322

323323
toolkit.print_line()
324324

325+
toolkit.print("Deployment Configuration", tag="summary")
326+
toolkit.print(f" Team: [bold]{team.name}[/bold]")
327+
toolkit.print(f" App: [bold]{app_name}[/bold]")
328+
toolkit.print_line()
329+
330+
choice = toolkit.ask(
331+
"Does everything look right?",
332+
tag="confirm",
333+
options=[
334+
Option({"name": "Yes, start the deployment!", "value": "deploy"}),
335+
Option({"name": "No, let me start over", "value": "cancel"}),
336+
],
337+
)
338+
toolkit.print_line()
339+
340+
if choice == "cancel":
341+
toolkit.print("Deployment cancelled.")
342+
raise typer.Exit(0)
343+
325344
with toolkit.progress(title="Creating app...") as progress:
326345
with handle_http_errors(progress):
327346
app = _create_app(team.id, app_name)

0 commit comments

Comments
 (0)