mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-16 00:49:32 +08:00
Add version command
This commit is contained in:
parent
ee29faecbf
commit
c03c41cb21
@ -45,6 +45,8 @@ func main() {
|
||||
plugin.NewSubCommandFunction("init", "Initialise a new plugin", commands.PluginInit)
|
||||
//plugin.NewSubCommandFunction("add", "Add a plugin", commands.PluginAdd)
|
||||
|
||||
app.NewSubCommandFunction("version", "Print the version", commands.Version)
|
||||
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
pterm.Error.Println(err)
|
||||
|
15
v3/internal/commands/version.go
Normal file
15
v3/internal/commands/version.go
Normal file
@ -0,0 +1,15 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
//go:embed version.txt
|
||||
var VersionString string
|
||||
|
||||
type VersionOptions struct{}
|
||||
|
||||
func Version(_ *VersionOptions) error {
|
||||
println(VersionString)
|
||||
return nil
|
||||
}
|
1
v3/internal/commands/version.txt
Normal file
1
v3/internal/commands/version.txt
Normal file
@ -0,0 +1 @@
|
||||
v3.0.0-alpha.0
|
Loading…
Reference in New Issue
Block a user