This commit is contained in:
parent
c0e975e139
commit
6f79719919
@ -17,6 +17,10 @@ builds:
|
|||||||
ignore:
|
ignore:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
goarch: "386"
|
goarch: "386"
|
||||||
|
# Custom ldflags templates.
|
||||||
|
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X github.com/abs3ntdev/haunt/cmd.Version={{.Version}}
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
|
@ -4,10 +4,9 @@ pipeline:
|
|||||||
commands:
|
commands:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
- go build -o bin/haunt
|
- go build -o bin/haunt
|
||||||
- mkdir completions
|
when:
|
||||||
- ./bin/haunt completion zsh > completions/haunt_zsh
|
event: push
|
||||||
- ./bin/haunt completion bash > completions/haunt_bash
|
|
||||||
- ./bin/haunt completion fish > completions/haunt_fish
|
|
||||||
publish:
|
publish:
|
||||||
image: goreleaser/goreleaser
|
image: goreleaser/goreleaser
|
||||||
commands:
|
commands:
|
||||||
|
@ -7,6 +7,8 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Version = "dev"
|
||||||
|
|
||||||
// versionCmd represents the version command
|
// versionCmd represents the version command
|
||||||
var versionCmd = &cobra.Command{
|
var versionCmd = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
@ -37,5 +39,5 @@ func init() {
|
|||||||
// Version print current version
|
// Version print current version
|
||||||
func version(cmd *cobra.Command, args []string) {
|
func version(cmd *cobra.Command, args []string) {
|
||||||
r := haunt.NewHaunt()
|
r := haunt.NewHaunt()
|
||||||
log.Println(r.Prefix(haunt.Green.Bold(haunt.RVersion)))
|
log.Println(r.Prefix(haunt.Green.Bold(Version)))
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
// RPrefix tool name
|
// RPrefix tool name
|
||||||
RPrefix = "haunt"
|
RPrefix = "haunt"
|
||||||
// RVersion current version
|
|
||||||
RVersion = "v0.1.3"
|
|
||||||
// RExt file extension
|
// RExt file extension
|
||||||
RExt = ".yaml"
|
RExt = ".yaml"
|
||||||
// RFile config file name
|
// RFile config file name
|
||||||
|
Loading…
Reference in New Issue
Block a user