change: improve cli output for wails update

closes #1528
This commit is contained in:
Lea Anthony
2022-07-08 19:53:13 +10:00
parent 39cebffa87
commit 1cd31573a9
3 changed files with 16 additions and 1 deletions
@@ -37,16 +37,25 @@ import (
)
func LogGreen(message string, args ...interface{}) {
if len(message) == 0 {
return
}
text := fmt.Sprintf(message, args...)
println(colour.Green(text))
}
func LogRed(message string, args ...interface{}) {
if len(message) == 0 {
return
}
text := fmt.Sprintf(message, args...)
println(colour.Red(text))
}
func LogDarkYellow(message string, args ...interface{}) {
if len(message) == 0 {
return
}
text := fmt.Sprintf(message, args...)
println(colour.DarkYellow(text))
}
@@ -55,6 +55,12 @@ func AddSubcommand(app *clir.Cli, w io.Writer, currentVersion string) error {
desiredVersion, err = github.GetLatestPreRelease()
} else {
desiredVersion, err = github.GetLatestStableRelease()
if err != nil {
println("")
println("No stable release found for this major version. To update to the latest pre-release (eg beta), run:")
println(" wails update -pre")
return nil
}
}
}
if err != nil {
+1 -1
View File
@@ -23,7 +23,7 @@ func fatal(message string) {
}
func banner(_ *clir.Cli) string {
return fmt.Sprintf("%s %s\n",
return fmt.Sprintf("%s %s",
colour.Yellow("Wails CLI"),
colour.DarkRed(internal.Version))
}