Skip to content

Commit

Permalink
Fix return code of delete when have less than asked to keep.
Browse files Browse the repository at this point in the history
BTW it is somewhat controversial: should we warn user automation?
  • Loading branch information
x4m committed Dec 7, 2017
1 parent a603f94 commit 1a98094
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ func HandleDelete(pre *Prefix, args []string) {
} else {
if len(backups) <= number {
fmt.Printf("Have only %v backups.\n", number)
} else {
cfg.target = backups[number-1].Name
DeleteBeforeTarget(cfg.target, bk, pre, cfg.find_full, nil, cfg.dryrun)
}
cfg.target = backups[number-1].Name
DeleteBeforeTarget(cfg.target, bk, pre, cfg.find_full, nil, cfg.dryrun)
}
}
}
Expand Down

0 comments on commit 1a98094

Please sign in to comment.