1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

prune: Add JSON output

This commit is contained in:
Dark Dragon 2025-02-05 22:59:26 +01:00
parent ae0835f12d
commit 57dd6e6482

View file

@ -211,9 +211,13 @@ func runPruneWithRepo(ctx context.Context, opts PruneOptions, gopts GlobalOption
printer.P("\nWould have made the following changes:")
}
err = printPruneStats(printer, plan.Stats())
if err != nil {
return err
if !gopts.JSON {
err = printPruneStats(printer, plan.Stats())
if err != nil {
return err
}
} else {
term.Print(ui.ToJSONString(plan.Stats()))
}
// Trigger GC to reset garbage collection threshold