Skip to content

Commit 1f30ed6

Browse files
committed
use exception
1 parent 3e49d83 commit 1f30ed6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

agentstack/cli/cli.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,13 @@ def init_project_builder(
4545
use_wizard: bool = False,
4646
):
4747
if not slug_name and not use_wizard:
48-
print(term_color("Project name is required. Use `agentstack init <project_name>`", 'red'))
49-
sys.exit(1)
48+
raise Exception("Project name is required. Use `agentstack init <project_name>`")
5049

5150
if slug_name and not is_snake_case(slug_name):
52-
print(term_color("Project name must be snake case", 'red'))
53-
sys.exit(1)
51+
raise Exception("Project slug name must be snake_case")
5452

5553
if template is not None and use_wizard:
56-
print(term_color("Template and wizard flags cannot be used together", 'red'))
57-
sys.exit(1)
54+
raise Exception("Template and wizard flags cannot be used together")
5855

5956
template_data = None
6057
if template is not None:

0 commit comments

Comments
 (0)