restore: add deletions to progress output

This commit is contained in:
Michael Eischer
2024-06-29 21:29:42 +02:00
parent f4b15fdd96
commit aa8e18cf32
8 changed files with 24 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ const (
ActionFileRestored ItemAction = "file restored"
ActionFileUpdated ItemAction = "file updated"
ActionFileUnchanged ItemAction = "file unchanged"
ActionDeleted ItemAction = "deleted"
)
func NewProgress(printer ProgressPrinter, interval time.Duration) *Progress {
@@ -126,6 +127,17 @@ func (p *Progress) AddSkippedFile(name string, size uint64) {
p.printer.CompleteItem(ActionFileUnchanged, name, size)
}
func (p *Progress) ReportDeletedFile(name string) {
if p == nil {
return
}
p.m.Lock()
defer p.m.Unlock()
p.printer.CompleteItem(ActionDeleted, name, 0)
}
func (p *Progress) Finish() {
p.updater.Done()
}