Skip to content

Commit 16a7da5

Browse files
committed
feat(cli): add name validation to templatecreate
This adds a validation step to ensure the template name is less than 32 characters.
1 parent 9da06be commit 16a7da5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/templatecreate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ func templateCreate() *cobra.Command {
4949
templateName = args[0]
5050
}
5151

52+
if len(templateName) > 31 {
53+
return xerrors.Errorf("Template name must be less than 32 characters")
54+
}
55+
5256
_, err = client.TemplateByName(cmd.Context(), organization.ID, templateName)
5357
if err == nil {
5458
return xerrors.Errorf("A template already exists named %q!", templateName)

0 commit comments

Comments
 (0)