fix(cli): pass integer to exit-on-eol (#3716)

This commit is contained in:
Teppei Fukuda
2023-03-01 12:18:11 +02:00
committed by GitHub
parent 23cdac02ee
commit bc0836623c
8 changed files with 51 additions and 58 deletions

View File

@@ -457,7 +457,7 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
return xerrors.Errorf("report error: %w", err)
}
exitOnEosl(opts, report.Metadata)
exitOnEOL(opts, report.Metadata)
Exit(opts, report.Results.Failed())
return nil
@@ -668,9 +668,10 @@ func Exit(opts flag.Options, failedResults bool) {
}
}
func exitOnEosl(opts flag.Options, m types.Metadata) {
if opts.ReportOptions.ExitOnEOSL && m.OS != nil && m.OS.Eosl {
Exit(opts, true)
func exitOnEOL(opts flag.Options, m types.Metadata) {
if opts.ExitOnEOL != 0 && m.OS != nil && m.OS.Eosl {
log.Logger.Errorf("Detected EOL OS: %s %s", m.OS.Family, m.OS.Name)
os.Exit(opts.ExitOnEOL)
}
}