Skip to content

Commit 89758cb

Browse files
chore: improve flash warning readability
1 parent d8ef7ce commit 89758cb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/arduino-flasher-cli/flash/flash.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/arduino/go-paths-helper"
2626
runas "github.com/arduino/go-windows-runas"
27+
"github.com/fatih/color"
2728
"github.com/spf13/cobra"
2829

2930
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
@@ -98,7 +99,7 @@ func runFlashCommand(ctx context.Context, args []string, forceYes bool, preserve
9899
}
99100

100101
if !forceYes && !preserveUser {
101-
feedback.Print("\nWARNING: flashing a new Linux image on the board will erase any existing data you have on it.")
102+
feedback.Print(color.RedString("\nWARNING: flashing a new Linux image will erase any existing data that you have on the board.\n"))
102103
feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", args[0])
103104

104105
var yesInput string

internal/updater/flasher.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"strings"
2525

2626
"github.com/arduino/go-paths-helper"
27+
"github.com/fatih/color"
2728
"github.com/shirou/gopsutil/v4/disk"
2829

2930
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
@@ -140,8 +141,8 @@ func FlashBoard(ctx context.Context, downloadedImagePath string, version string,
140141
if errT != nil {
141142
warnStr = errT.Error()
142143
}
143-
feedback.Printf("\nWARNING: %s.", warnStr)
144-
feedback.Printf("Do you want to proceed and flash %s on the board, erasing any existing data you have on it? (yes/no)", target)
144+
feedback.Print(color.RedString("\nWARNING: %s. It will not be possible to preserve your data.\n", warnStr))
145+
feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", target)
145146

146147
var yesInput string
147148
_, err := fmt.Scanf("%s\n", &yesInput)

0 commit comments

Comments
 (0)