mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 13:19:00 -07:00
Compare commits
3 Commits
replace-wa
...
v0.9.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ac993b01f | ||
|
|
216c84b9cf | ||
|
|
e99fffe340 |
@@ -106,6 +106,15 @@ func (p *ProgramHelper) RunCommand(command string) error {
|
||||
return p.RunCommandArray(args)
|
||||
}
|
||||
|
||||
func (p *ProgramHelper) GetOutputFromCommand(command string) (string, string, error) {
|
||||
args := strings.Split(command, " ")
|
||||
if len(args) > 1 {
|
||||
return p.shell.Run(args[0], args[1:]...)
|
||||
} else {
|
||||
return p.shell.Run(args[0])
|
||||
}
|
||||
}
|
||||
|
||||
// RunCommandArray runs the command specified in the array
|
||||
func (p *ProgramHelper) RunCommandArray(args []string) error {
|
||||
program := args[0]
|
||||
|
||||
@@ -2,4 +2,4 @@ package cmd
|
||||
|
||||
// Version - Wails version
|
||||
// ...oO(There must be a better way)
|
||||
const Version = "v0.9.2"
|
||||
const Version = "v0.9.4"
|
||||
|
||||
20
cmd/wails/10_version.go
Normal file
20
cmd/wails/10_version.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/wailsapp/wails/cmd"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
commandDescription := `Outputs the current version of the wails cli tool.`
|
||||
|
||||
versionCommand := app.Command("version", "Print Wails cli version").
|
||||
LongDescription(commandDescription)
|
||||
|
||||
versionCommand.Action(func() error {
|
||||
fmt.Println(cmd.Version)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -54,13 +54,18 @@ func init() {
|
||||
updateSpinner := spinner.NewSpinner()
|
||||
updateSpinner.SetSpinSpeed(40)
|
||||
updateSpinner.Start("Updating to : " + latestVersion)
|
||||
err = cmd.NewProgramHelper().RunCommandArray([]string{"go","get","-u","github.com/wailsapp/wails/cmd/wails"})
|
||||
err = cmd.NewProgramHelper().RunCommandArray([]string{"go","get","-u","-v","github.com/wailsapp/wails/cmd/wails"})
|
||||
if err != nil {
|
||||
updateSpinner.Error(err.Error())
|
||||
return err
|
||||
}
|
||||
updateSpinner.Success()
|
||||
logger.Yellow("Wails updated to " + latestVersion)
|
||||
version, _, err := cmd.NewProgramHelper().GetOutputFromCommand("wails version")
|
||||
if err != nil {
|
||||
updateSpinner.Error(err.Error())
|
||||
return err
|
||||
}
|
||||
logger.Yellow("Wails updated to " + version)
|
||||
} else {
|
||||
logger.Yellow("Looks like you're up to date!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user