Skip to content

Commit e7c1916

Browse files
committed
chore(trdl-vault): add validation for flag project-name
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
1 parent 70557db commit e7c1916

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

release/common/common.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package common
22

33
import (
4+
"log"
45
"net/url"
56
"os"
67
"time"
@@ -11,6 +12,10 @@ import (
1112
func SetupProjectName(cmdData *CmdData, cmd *cobra.Command) {
1213
cmdData.ProjectName = new(string)
1314
cmd.PersistentFlags().StringVarP(cmdData.ProjectName, "project-name", "N", os.Getenv("TRDL_PROJECT_NAME"), "Set a specific project name")
15+
if *cmdData.ProjectName == "" {
16+
log.Fatal("Project name is required. Please specify the --project-name flag or set the TRDL_PROJECT_NAME environment variable.")
17+
}
18+
1419
}
1520

1621
func SetupVaultAddress(cmdData *CmdData, cmd *cobra.Command) {

0 commit comments

Comments
 (0)