This commit is contained in:
parent
2b0ea8ed9d
commit
50d5cd18a8
@ -17,6 +17,8 @@ builds:
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: "386"
|
||||
ldflags:
|
||||
- -s -w -X git.asdf.cafe/abs3nt/gospt/src.cmd.Version={{.Version}}
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
|
23
src/cmd/version.go
Normal file
23
src/cmd/version.go
Normal file
@ -0,0 +1,23 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var Version = "v0.0.47"
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Prints current verison",
|
||||
Run: version,
|
||||
}
|
||||
|
||||
func version(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("Gospt: %s\n", Version)
|
||||
}
|
Loading…
Reference in New Issue
Block a user