Skip to content

Commit

Permalink
don't try to open empty file name
Browse files Browse the repository at this point in the history
  • Loading branch information
e-asphyx committed Jul 15, 2021
1 parent add13e0 commit 12fa854
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ func NewRootCommand(c *Context, name string) *cobra.Command {
PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) {
// cmd always points to the top level command!!!
conf := config.Default()
conf.Read(configFile)
if configFile != "" {
conf.Read(configFile)
}

validate := config.Validator()
if err := validate.Struct(conf); err != nil {
Expand Down

0 comments on commit 12fa854

Please sign in to comment.