Skip to content

Commit

Permalink
move setExitCode logic to bottom of function
Browse files Browse the repository at this point in the history
  • Loading branch information
kimschles committed Jun 24, 2019
1 parent 29261ed commit 9b755b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,6 @@ func runAudit(c conf.Configuration, auditPath string, setExitCode bool, outputFi
panic(err)
}

if setExitCode && auditData.ClusterSummary.Results.Totals.Errors > 0 {
logrus.Infof("Error found. Exiting audit.")
os.Exit(3)
}

var outputBytes []byte
if outputFormat == "score" {
outputBytes = []byte(fmt.Sprint(auditData.ClusterSummary.Score))
Expand Down Expand Up @@ -259,4 +254,9 @@ func runAudit(c conf.Configuration, auditPath string, setExitCode bool, outputFi
}
}
}

if setExitCode && auditData.ClusterSummary.Results.Totals.Errors > 0 {
logrus.Infof("Error found. Exiting audit.")
os.Exit(3)
}
}

0 comments on commit 9b755b8

Please sign in to comment.