Skip to content

Commit bb53f7e

Browse files
chore: improve download command feedback to the user
1 parent a2f6aab commit bb53f7e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

download.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func newDownloadCmd() *cobra.Command {
3434
Short: "Download a Linux image to the specified path",
3535
Args: cobra.ExactArgs(1),
3636
Example: " " + os.Args[0] + " download latest\n" +
37+
" " + os.Args[0] + " download 20251024-412\n" +
3738
" " + os.Args[0] + " download latest --dest-dir /tmp\n",
3839
Run: func(cmd *cobra.Command, args []string) {
3940
runDownloadCommand(cmd.Context(), args, destDir)
@@ -52,8 +53,10 @@ func runDownloadCommand(ctx context.Context, args []string, destDir string) {
5253
}
5354

5455
client := updater.NewClient()
55-
_, _, err := updater.DownloadImage(ctx, client, targetVersion, nil, true, downloadPath)
56+
downloadPath, _, err := updater.DownloadImage(ctx, client, targetVersion, nil, true, downloadPath)
5657
if err != nil {
5758
feedback.Fatal(i18n.Tr("error downloading the image: %v", err), feedback.ErrBadArgument)
5859
}
60+
pathAbs, _ := downloadPath.Abs()
61+
feedback.Print(i18n.Tr("\nDebian image successfully downloaded: %s", pathAbs.String()))
5962
}

updater/download_image.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ func DownloadImage(ctx context.Context, client *Client, targetVersion string, up
135135
return nil, "", fmt.Errorf("bad hash: %x (expected %x)", s, sha256Byte)
136136
}
137137

138-
feedback.Print(i18n.Tr("Download of Debian image completed"))
139-
140138
return tmpZip, rel.Version, nil
141139
}
142140

0 commit comments

Comments
 (0)