version
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
abs3nt 2023-03-11 21:39:46 -08:00
parent 2b0ea8ed9d
commit 50d5cd18a8
Signed by: abs3nt
GPG Key ID: FDC6662313FA9386
2 changed files with 25 additions and 0 deletions

View File

@ -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
View 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)
}