Skip to content

Commit 887f108

Browse files
Update main.go
Co-authored-by: Luca Rinaldi <lucarin@protonmail.com>
1 parent 358d545 commit 887f108

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,22 @@ func main() {
6161
Use: "version",
6262
Short: "Print the version number of Arduino Flasher CLI",
6363
Run: func(cmd *cobra.Command, args []string) {
64-
feedback.Print("Arduino Flasher CLI " + Version)
65-
latest, err := checkForUpdates()
64+
feedback.PrintResult(versionResult{
65+
Name: "Arduino Flasher CLI",
66+
Version: Version,
67+
})
68+
69+
latest, err := checkForUpdates(1 * time.Second)
6670
if err != nil {
67-
feedback.Warning("\n\nfailed to check for updates: " + err.Error())
71+
feedback.Warning(color.YellowString("Failed to check for updates: "+err.Error()) + "\n")
6872
}
6973
if latest != "" {
70-
msg := fmt.Sprintf("\n\n%s %s → %s\n%s",
74+
msg := fmt.Sprintf("%s %s → %s\n%s",
7175
color.YellowString(i18n.Tr("A new release of Arduino Flasher CLI is available:")),
7276
color.CyanString(Version),
7377
color.CyanString(latest),
7478
color.YellowString("https://www.arduino.cc/en/software/#flasher-tool"))
75-
feedback.Print(msg)
79+
feedback.Warning(msg + "\n")
7680
}
7781
},
7882
})

0 commit comments

Comments
 (0)