From 89758cb5a78d3391a87a425deaab6145051ee9a6 Mon Sep 17 00:00:00 2001 From: MatteoPologruto Date: Fri, 19 Dec 2025 10:50:13 +0100 Subject: [PATCH] chore: improve flash warning readability --- cmd/arduino-flasher-cli/flash/flash.go | 3 ++- internal/updater/flasher.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/arduino-flasher-cli/flash/flash.go b/cmd/arduino-flasher-cli/flash/flash.go index d7f5862..89fe943 100644 --- a/cmd/arduino-flasher-cli/flash/flash.go +++ b/cmd/arduino-flasher-cli/flash/flash.go @@ -24,6 +24,7 @@ import ( "github.com/arduino/go-paths-helper" runas "github.com/arduino/go-windows-runas" + "github.com/fatih/color" "github.com/spf13/cobra" "github.com/arduino/arduino-flasher-cli/cmd/feedback" @@ -98,7 +99,7 @@ func runFlashCommand(ctx context.Context, args []string, forceYes bool, preserve } if !forceYes && !preserveUser { - feedback.Print("\nWARNING: flashing a new Linux image on the board will erase any existing data you have on it.") + feedback.Print(color.RedString("\nWARNING: flashing a new Linux image will erase any existing data that you have on the board.\n")) feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", args[0]) var yesInput string diff --git a/internal/updater/flasher.go b/internal/updater/flasher.go index 94a621f..0778bff 100644 --- a/internal/updater/flasher.go +++ b/internal/updater/flasher.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/arduino/go-paths-helper" + "github.com/fatih/color" "github.com/shirou/gopsutil/v4/disk" "github.com/arduino/arduino-flasher-cli/cmd/feedback" @@ -140,8 +141,8 @@ func FlashBoard(ctx context.Context, downloadedImagePath string, version string, if errT != nil { warnStr = errT.Error() } - feedback.Printf("\nWARNING: %s.", warnStr) - feedback.Printf("Do you want to proceed and flash %s on the board, erasing any existing data you have on it? (yes/no)", target) + feedback.Print(color.RedString("\nWARNING: %s. It will not be possible to preserve your data.\n", warnStr)) + feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", target) var yesInput string _, err := fmt.Scanf("%s\n", &yesInput)