Skip to content

Commit

Permalink
no hyphen at the end of env name
Browse files Browse the repository at this point in the history
  • Loading branch information
boppanasusanth committed Feb 27, 2024
1 parent 94e4b66 commit 3ac4da4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ type application struct {
// App (Application) interface
var App application = application{
Name: "odin",
Version: "1.3.2",
Version: "1.3.3",
}
4 changes: 2 additions & 2 deletions internal/command/commands/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func (e *Env) Run(args []string) int {
e.Logger.Error("Env Name should not be of length more than 9")
return 1
}
if (utils.SearchString(*name, "^[a-z][a-z0-9-]*$")) == "nil" {
e.Logger.Error("Env name only allows lower case alphabets, numbers and '-'. And should start with an alphabet.")
if (utils.SearchString(*name, "^[a-z]([a-z0-9-]*[a-z0-9])?$")) == "nil" {
e.Logger.Error("Env name only allows lower case alphabets, numbers and '-'. Should start with an alphabet and not end with a hyphen.")
return 1
}
envConfig := environment.Env{
Expand Down

0 comments on commit 3ac4da4

Please sign in to comment.