@@ -46,17 +46,12 @@ type Release struct {
4646// DownloadConfirmCB is a function that is called when a Debian image is ready to be downloaded.
4747type DownloadConfirmCB func (target string ) (bool , error )
4848
49- func DownloadAndExtract (ctx context.Context , client * Client , targetVersion string , temp * paths.Path ) (* paths.Path , string , error ) {
50- tmpZip , version , err := DownloadImage (ctx , client , targetVersion , temp )
49+ func DownloadAndExtract (ctx context.Context , targetVersion string , temp * paths.Path ) (* paths.Path , string , error ) {
50+ tmpZip , version , err := DownloadImage (ctx , targetVersion , temp )
5151 if err != nil {
5252 return nil , "" , fmt .Errorf ("error downloading the image: %v" , err )
5353 }
5454
55- // Download not confirmed
56- if tmpZip == nil {
57- return nil , "" , nil
58- }
59-
6055 err = ExtractImage (ctx , tmpZip , tmpZip .Parent ())
6156 if err != nil {
6257 return nil , "" , fmt .Errorf ("error extracting the image: %v" , err )
@@ -69,10 +64,10 @@ func DownloadAndExtract(ctx context.Context, client *Client, targetVersion strin
6964 return imagePath , version , nil
7065}
7166
72- func DownloadImage (ctx context.Context , client * Client , targetVersion string , downloadPath * paths.Path ) (* paths.Path , string , error ) {
67+ func DownloadImage (ctx context.Context , targetVersion string , downloadPath * paths.Path ) (* paths.Path , string , error ) {
7368 var err error
7469
75- feedback . Print ( i18n . Tr ( "Checking for Debian image releases" ) )
70+ client := NewClient ( )
7671 manifest , err := client .GetInfoManifest (ctx )
7772 if err != nil {
7873 return nil , "" , err
0 commit comments