Skip to content

Commit

Permalink
cli: support '--example=empty' to create empty app
Browse files Browse the repository at this point in the history
To support scripting without the interactive template picker,
add `--example=empty` as a way to create an empty app.

Thanks Ismoil Hasanov for the suggestion.
  • Loading branch information
eandre committed Aug 1, 2023
1 parent 5f5e6da commit 52f21ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/cmd/encore/app/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func createApp(ctx context.Context, name, template string) (err error) {
if name == "" || template == "" {
name, template = selectTemplate(name, template)
}
// Treat the special name "empty" as the empty app template
// (the rest of the code assumes that's the empty string).
if template == "empty" {
template = ""
}

if err := validateName(name); err != nil {
return err
Expand Down

0 comments on commit 52f21ef

Please sign in to comment.