cmd/mbf: cure status report command
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 46s
Test / Hakurei (push) Successful in 2m40s
Test / ShareFS (push) Successful in 2m38s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m29s
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 46s
Test / Hakurei (push) Successful in 2m40s
Test / ShareFS (push) Successful in 2m38s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m29s
This emits a report stream for the opened cache into the specified file. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -195,6 +195,41 @@ func main() {
|
||||
)
|
||||
}
|
||||
|
||||
c.NewCommand(
|
||||
"report",
|
||||
"Generate an artifact cure report for the current cache",
|
||||
func(args []string) (err error) {
|
||||
var w *os.File
|
||||
switch len(args) {
|
||||
case 0:
|
||||
w = os.Stdout
|
||||
|
||||
case 1:
|
||||
if w, err = os.OpenFile(
|
||||
args[0],
|
||||
os.O_CREATE|os.O_EXCL|syscall.O_WRONLY,
|
||||
0,
|
||||
); err != nil {
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
closeErr := w.Close()
|
||||
if err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
}()
|
||||
|
||||
default:
|
||||
return errors.New("report requires 1 argument")
|
||||
}
|
||||
|
||||
if container.Isatty(int(w.Fd())) {
|
||||
return errors.New("output appears to be a terminal")
|
||||
}
|
||||
return rosa.WriteReport(msg, w, cache)
|
||||
},
|
||||
)
|
||||
|
||||
c.NewCommand("updates", command.UsageInternal, func([]string) error {
|
||||
var n int
|
||||
for i := range rosa.PresetEnd {
|
||||
|
||||
Reference in New Issue
Block a user