Skip to content

Commit 356248c

Browse files
committed
refactor: combine deployment target auto-select conditions
1 parent 6fba71e commit 356248c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

agent_starter_pack/cli/commands/create.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -741,18 +741,18 @@ def create(
741741
f"Error: No deployment targets available for agent '{deployment_agent_name}'."
742742
)
743743
# Auto-select if only one target available or in auto-approve mode
744-
if len(available_targets) == 1:
744+
if len(available_targets) == 1 or auto_approve:
745745
final_deployment = available_targets[0]
746-
console.print(
747-
f"Info: Using '{final_deployment}' (only available deployment target for this agent).",
748-
style="yellow",
749-
)
750-
elif auto_approve:
751-
final_deployment = available_targets[0]
752-
console.print(
753-
f"Info: --deployment-target not specified. Defaulting to '{final_deployment}' in auto-approve mode.",
754-
style="yellow",
755-
)
746+
if len(available_targets) == 1:
747+
console.print(
748+
f"Info: Using '{final_deployment}' (only available deployment target for this agent).",
749+
style="yellow",
750+
)
751+
else:
752+
console.print(
753+
f"Info: --deployment-target not specified. Defaulting to '{final_deployment}' in auto-approve mode.",
754+
style="yellow",
755+
)
756756
else:
757757
final_deployment = prompt_deployment_target(
758758
deployment_agent_name, remote_config=remote_config

0 commit comments

Comments
 (0)