Skip to content

Commit

Permalink
rpk/transform/init: bail on empty name input
Browse files Browse the repository at this point in the history
This is the more common behavior in RPK, and we want to align this
command with that.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
  • Loading branch information
rockwotj committed Oct 5, 2023
1 parent 9a98aa7 commit 6bcfa72
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 6bcfa72

Please sign in to comment.