Skip to content

Commit

Permalink
fix: only validate the config when running dump or monitor cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
marianozunino committed Nov 21, 2024
1 parent 317d018 commit 35f4ccb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ func initConfig() {

func run(cmd *cobra.Command, args []string) {
// Validate required fields
if err := validateRequiredFields(); err != nil {
color.Red("Validation error: %v", err)
os.Exit(1)
switch cmd.Use {
case "dump", "monitor":
if err := validateRequiredFields(); err != nil {
color.Red("Validation error: %v", err)
os.Exit(1)
}
}
}

Expand Down

0 comments on commit 35f4ccb

Please sign in to comment.