Skip to content

Commit

Permalink
🐛 exit code when asset connection failed (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock authored Dec 2, 2022
1 parent 0dcad44 commit b4de937
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/cnspec/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ This example connects to Microsoft 365 using the PKCS #12 formatted certificate:
}
printReports(report, conf, cmd)

// if we had asset errors, we return a non-zero exit code
// asset errors are only connection issues
if len(report.Errors) > 0 {
os.Exit(1)
}

if report.GetWorstScore() < uint32(conf.ScoreThreshold) {
os.Exit(1)
}
Expand Down

0 comments on commit b4de937

Please sign in to comment.