Get version from reseed.Version in Makefile
This commit is contained in:
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
|
||||
VERSION=0.3.3
|
||||
VERSION=$(shell ./reseed-tools-linux-amd64 version 2>/dev/null)
|
||||
APP=reseed-tools
|
||||
USER_GH=eyedeekay
|
||||
SIGNER=hankhill19580@gmail.com
|
||||
|
19
cmd/version.go
Normal file
19
cmd/version.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v3"
|
||||
"i2pgit.org/idk/reseed-tools/reseed"
|
||||
)
|
||||
|
||||
func NewVersionCommand() *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "version",
|
||||
Usage: "Print the version number of reseed-tools",
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Printf("%s\n", reseed.Version)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user