feat(flag): add exit-on-eosl option (#3423)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Jack Lin
2023-02-15 16:51:15 +08:00
committed by GitHub
parent aa8e185e03
commit 32acd293fd
8 changed files with 92 additions and 1 deletions

View File

@@ -454,6 +454,7 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
return xerrors.Errorf("report error: %w", err)
}
exitOnEosl(opts, report.Metadata)
Exit(opts, report.Results.Failed())
return nil
@@ -663,6 +664,12 @@ 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 canonicalVersion(ver string) string {
if ver == devVersion {
return ver