We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21eb9c6 commit 2aaff87Copy full SHA for 2aaff87
cmd/prompt.go
@@ -28,7 +28,7 @@ import (
28
29
var (
30
validEnvName = regexp.MustCompile(`^[A-Z0-9-_]+$`)
31
- validName = regexp.MustCompile(`^[a-z][a-z0-9-_]*$`)
+ validName = regexp.MustCompile(`^[a-z0-9]([a-z0-9-]*[a-z0-9])?$`)
32
validPath = regexp.MustCompile(`^(/[a-zA-Z0-9-_]+)+$`)
33
)
34
@@ -472,7 +472,7 @@ func validateEnvName(val interface{}) error {
472
473
func validateName(val interface{}) error {
474
if !validName.MatchString(val.(string)) {
475
- return errors.New("Name must start with a-z followed by a-z, 0-9, dash (-) or underscore (_)")
+ return errors.New("Name must only contain a-z, 0-9 or dash (-), and must start and end with a-z or 0-9")
476
}
477
return nil
478
0 commit comments