Skip to content

Commit

Permalink
Merge pull request redpanda-data#13965 from rockwotj/rpk-transform-in…
Browse files Browse the repository at this point in the history
…it-for

rpk/transform/init: bail on empty name input
  • Loading branch information
rockwotj authored Oct 5, 2023
2 parents 7e0d51b + 6bcfa72 commit d132f9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/go/rpk/pkg/cli/transform/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ Will initialize a transform project in the foobar directory.
if ok {
out.Die("there is already a transform at %q, please delete it before retrying", c)
}
for name == "" {
if name == "" {
suggestion := filepath.Base(path)
if suggestion == "." {
suggestion = ""
}
name, err = out.PromptWithSuggestion(suggestion, "name this transform:")
out.MaybeDie(err, "unable to determine project name: %v", err)
if name == "" {
out.Die("transform name is required")
}
}
if lang == "" {
langVal, err := out.Pick(project.AllWasmLangs, "select a language:")
Expand Down

0 comments on commit d132f9d

Please sign in to comment.