From 98eae90924978cd5fea0a75a91e39f4634ccc40a Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Thu, 31 Aug 2023 13:05:52 +0530 Subject: [PATCH] Do not print completed header if no backups (#4124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: ``` Logging to file: /home/meain/.cache/corso/logs/2023-08-28T07-18-24Z.log Connecting to repository: 1s done Connecting to M365: 0s done Backing Up ∙ Security Group Discovering items to backup: 2s done Completed Backups: # <--- Unnecessary No backups available ``` --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/cli/backup/backup.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/backup/backup.go b/src/cli/backup/backup.go index f9bdc3781..1cee170d8 100644 --- a/src/cli/backup/backup.go +++ b/src/cli/backup/backup.go @@ -255,7 +255,10 @@ func runBackups( return Only(ctx, clues.Wrap(berrs.Failure(), "Unable to retrieve backup results from storage")) } - Info(ctx, "Completed Backups:") + if len(bups) > 0 { + Info(ctx, "Completed Backups:") + } + backup.PrintAll(ctx, bups) if len(errs) > 0 {