@@ -32,7 +32,7 @@ func Flash(ctx context.Context, imagePath *paths.Path, version string, forceYes
3232 if ! imagePath .Exist () {
3333 client := NewClient ()
3434
35- tempImagePath , err := DownloadAndExtract (client , version , func (target string ) (bool , error ) {
35+ tempImagePath , v , err := DownloadAndExtract (client , version , func (target string ) (bool , error ) {
3636 feedback .Printf ("Found Debian image version: %s" , target )
3737 feedback .Printf ("Do you want to download it? (yes/no)" )
3838
@@ -56,6 +56,7 @@ func Flash(ctx context.Context, imagePath *paths.Path, version string, forceYes
5656
5757 defer tempImagePath .Parent ().RemoveAll ()
5858
59+ version = v
5960 imagePath = tempImagePath
6061 } else if ! imagePath .IsDir () {
6162 temp , err := GetTempDir ("extract-" )
@@ -77,7 +78,7 @@ func Flash(ctx context.Context, imagePath *paths.Path, version string, forceYes
7778 imagePath = tempContent [0 ]
7879 }
7980
80- return FlashBoard (ctx , imagePath .String (), func (target string ) (bool , error ) {
81+ return FlashBoard (ctx , imagePath .String (), version , func (target string ) (bool , error ) {
8182 feedback .Print ("\n WARNING: flashing a new Linux image on the board will erase any existing data you have on it." )
8283 feedback .Printf ("Do you want to procede and flash %s on the board? (yes/no)" , target )
8384
@@ -91,9 +92,9 @@ func Flash(ctx context.Context, imagePath *paths.Path, version string, forceYes
9192 }, forceYes )
9293}
9394
94- func FlashBoard (ctx context.Context , downloadedImagePath string , upgradeConfirmCb DownloadConfirmCB , forceYes bool ) error {
95+ func FlashBoard (ctx context.Context , downloadedImagePath string , version string , upgradeConfirmCb DownloadConfirmCB , forceYes bool ) error {
9596 if ! forceYes {
96- res , err := upgradeConfirmCb (downloadedImagePath )
97+ res , err := upgradeConfirmCb (version )
9798 if err != nil {
9899 return err
99100 }
@@ -152,5 +153,7 @@ func FlashBoard(ctx context.Context, downloadedImagePath string, upgradeConfirmC
152153 return err
153154 }
154155
156+ feedback .Print ("\n The board has been successfully flashed. You can now power-cycle the board (unplug and re-plug). Remember to remove the jumper." )
157+
155158 return nil
156159}
0 commit comments