Skip to content

Commit

Permalink
fix: only read configuration file if not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Jun 1, 2024
1 parent 6d7df76 commit affeb6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ctfd-setup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func main() {

if err := app.RunContext(ctx, os.Args); err != nil {
ctfdsetup.Log().Error("fatal error", zap.Error(err))
os.Exit(1)
}
}

Expand Down Expand Up @@ -573,7 +574,7 @@ func run(ctx *cli.Context) error {
}

// Read and unmarshal setup config file if any
if ctx.IsSet("file") {
if ctx.IsSet("file") && ctx.String("file") != "" {
f := ctx.String("file")
log.Info("getting configuration file", zap.String("file", f))
if _, err := os.Stat(f); err == nil {
Expand Down

0 comments on commit affeb6f

Please sign in to comment.