Skip to content

Commit 7a175e9

Browse files
committed
refact(diff): inform user if no current target is found and considered
Signed-off-by: Mike Sul <mike.sul@foundries.io>
1 parent 6ddd0b7 commit 7a175e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/fioup/diff.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ func doDiff(cmd *cobra.Command, opts *diffOptions) {
6262
"please run the 'check' command to obtain the metadata and try again"))
6363
}
6464
DieNotNil(err, "failed to obtain diff:")
65+
if diff.FromTarget.IsUnknown() {
66+
fmt.Println("Failed to get current target: diff computed assuming no update is installed")
67+
}
6568
fmt.Printf("Update size from version %d to %d:\n", diff.FromTarget.Version, diff.ToTarget.Version)
6669
fmt.Printf(" On wire size: %s\n", compose.FormatBytesInt64(diff.WireSize))
6770
fmt.Printf(" On disk size: %s\n", compose.FormatBytesInt64(diff.DiskSize))

0 commit comments

Comments
 (0)