Skip to content

Commit c1da21c

Browse files
authored
Tobias/lk app create panic fix (#790)
* fix(app): check for presence of project before creating app * chore: bump version * chore(app): only default to project name in interactive mode
1 parent da6a1b2 commit c1da21c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/lk/app.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ var (
5555
Name: "create",
5656
Usage: "Bootstrap a new application from a template or through guided creation",
5757
Action: setupTemplate,
58+
Before: requireProject,
5859
ArgsUsage: "`APP_NAME`",
5960
Flags: []cli.Flag{
6061
templateFlag,
@@ -300,14 +301,15 @@ func setupTemplate(ctx context.Context, cmd *cli.Command) error {
300301
arg := cmd.Args().First()
301302
if arg != "" {
302303
appName = arg
303-
} else {
304-
appName = project.Name
305304
}
306305
}
307306
if appName == "" {
308307
if SkipPrompts(cmd) {
309308
return errors.New("non-interactive mode: provide app name as argument")
310309
}
310+
if project != nil {
311+
appName = project.Name
312+
}
311313
preinstallPrompts = append(preinstallPrompts, huh.NewInput().
312314
Title("Application Name").
313315
Placeholder("my-app").

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
package livekitcli
1616

1717
const (
18-
Version = "2.15.0"
18+
Version = "2.15.1"
1919
)

0 commit comments

Comments
 (0)