From 52f21ef0f768f0a92d0e181bb8d01948cd4a4708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Eriksson?= Date: Tue, 1 Aug 2023 13:25:46 +0200 Subject: [PATCH] cli: support '--example=empty' to create empty app 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. --- cli/cmd/encore/app/create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/cmd/encore/app/create.go b/cli/cmd/encore/app/create.go index c0fdd21874..5afbcc9a75 100644 --- a/cli/cmd/encore/app/create.go +++ b/cli/cmd/encore/app/create.go @@ -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