You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseException(f"Template {template} not found in {templates_dir}")
163
-
else:
164
-
print("\n[bold]Available templates:[/bold]")
165
-
foridx, template_nameinenumerate(templates, 1):
166
-
print(f" {idx}. {template_name}")
167
-
whileTrue:
168
-
try:
169
-
choice=IntPrompt.ask(
170
-
"\nSelect template number",
171
-
show_choices=False,
172
-
show_default=False,
173
-
)
174
-
if1<=choice<=len(templates):
175
-
template=templates[choice-1]
176
-
break
177
-
else:
178
-
print(
179
-
"[red]Invalid selection. Please choose a number from the list.[/red]"
180
-
)
181
-
except (KeyboardInterrupt, EOFError):
182
-
raisetyper.Abort()
183
-
exceptValueError:
184
-
print("[red]Please enter a valid number.[/red]")
185
-
186
-
iftemplateingit_templates:
187
-
project_name=template
188
-
else:
189
-
ifproject_nameisNone:
190
-
project_name=typing.cast(
191
-
str,
192
-
typer.prompt("What is your project's name?", get_project_name()),
193
-
)
194
-
195
-
ifnot_is_valid_app_name(project_name):
196
-
raiseException(
197
-
f"{project_name} is an invalid DBOS app name. App names must be between 3 and 30 characters long and contain only lowercase letters, numbers, dashes, and underscores."
raiseException(f"Template {template} not found in {templates_dir}")
188
+
else:
189
+
print("\n[bold]Available templates:[/bold]")
190
+
foridx, template_nameinenumerate(templates, 1):
191
+
print(f" {idx}. {template_name}")
192
+
whileTrue:
193
+
try:
194
+
choice=IntPrompt.ask(
195
+
"\nSelect template number",
196
+
show_choices=False,
197
+
show_default=False,
198
+
)
199
+
if1<=choice<=len(templates):
200
+
template=templates[choice-1]
201
+
break
202
+
else:
203
+
print(
204
+
"[red]Invalid selection. Please choose a number from the list.[/red]"
205
+
)
206
+
except (KeyboardInterrupt, EOFError):
207
+
raisetyper.Abort()
208
+
exceptValueError:
209
+
print("[red]Please enter a valid number.[/red]")
210
+
211
+
iftemplateingit_templates:
212
+
ifproject_nameisNone:
213
+
project_name=template
214
+
else:
215
+
ifproject_nameisNone:
216
+
project_name=typing.cast(
217
+
str,
218
+
typer.prompt("What is your project's name?", get_project_name()),
219
+
)
220
+
221
+
ifnot_is_valid_app_name(project_name):
222
+
raiseException(
223
+
f"{project_name} is an invalid DBOS app name. App names must be between 3 and 30 characters long and contain only lowercase letters, numbers, dashes, and underscores."
224
+
)
225
+
226
+
assertproject_nameisnotNone, "Project name cannot be None"
227
+
asserttemplateisnotNone, "Template name cannot be None"
228
+
229
+
returnproject_name, template
230
+
231
+
210
232
@app.command(
211
233
help="Run your database schema migrations using the migration commands in 'dbos-config.yaml'"
0 commit comments