Skip to content

feat(cli): validate name length on template create #3823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup!: use utf8.RuneCountInString
  • Loading branch information
jsjoeio committed Sep 2, 2022
commit 50d71479d3ae1d35af57be9510b4a357ea86d55e
3 changes: 2 additions & 1 deletion cli/templatecreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"
"strings"
"time"
"unicode/utf8"

"github.com/briandowns/spinner"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -49,7 +50,7 @@ func templateCreate() *cobra.Command {
templateName = args[0]
}

if len(templateName) > 31 {
if utf8.RuneCountInString(templateName) > 31 {
return xerrors.Errorf("Template name must be less than 32 characters")
}

Expand Down