Get version from reseed.Version in Makefile

This commit is contained in:
eyedeekay
2025-01-30 16:12:55 -05:00
parent bfd851b3f8
commit 7f7a74bf48
3 changed files with 21 additions and 1 deletions

View File

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

View File

@ -33,6 +33,7 @@ func main() {
cmd.NewSu3VerifyCommand(),
cmd.NewKeygenCommand(),
cmd.NewShareCommand(),
cmd.NewVersionCommand(),
// cmd.NewSu3VerifyPublicCommand(),
}