mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
Change the way to receive version
- Used git to receive version from tags (see #304) - Version now displayed when start node (fix #102) Example: → ./bin/node --version neo-go version 0.44.10-245-g67d5e9f → ./bin/node -v neo-go version 0.44.10-245-g67d5e9f
This commit is contained in:
parent
f1cdd2222b
commit
902125cbeb
2 changed files with 4 additions and 1 deletions
3
Makefile
3
Makefile
|
@ -1,9 +1,10 @@
|
|||
BRANCH = "master"
|
||||
BUILD_TIME = "$(shell date -u +\"%Y-%m-%dT%H:%M:%SZ\")"
|
||||
VERSION = $(shell cat ./VERSION)
|
||||
REPONAME = "neo-go"
|
||||
NETMODE ?= "privnet"
|
||||
|
||||
VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')"
|
||||
|
||||
build:
|
||||
@echo "=> Building darwin binary"
|
||||
@go build -i -ldflags "-X github.com/CityOfZion/neo-go/config.Version=${VERSION}-dev -X github.com/CityOfZion/neo-go/config.BuildTime=${BUILD_TIME}" -o ./bin/neo-go ./cli/main.go
|
||||
|
|
|
@ -7,12 +7,14 @@ import (
|
|||
"github.com/CityOfZion/neo-go/cli/smartcontract"
|
||||
"github.com/CityOfZion/neo-go/cli/vm"
|
||||
"github.com/CityOfZion/neo-go/cli/wallet"
|
||||
"github.com/CityOfZion/neo-go/config"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctl := cli.NewApp()
|
||||
ctl.Name = "neo-go"
|
||||
ctl.Version = config.Version
|
||||
ctl.Usage = "Official Go client for Neo"
|
||||
|
||||
ctl.Commands = []cli.Command{
|
||||
|
|
Loading…
Reference in a new issue