Skip to content

Commit

Permalink
add version flag to griddriver
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioBassem committed Oct 1, 2024
1 parent 61de063 commit f03f2c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion griddriver/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi


go env -w CGO_ENABLED="0"
go build -o ~/go/bin/griddriver
go build -ldflags="-X 'main.version=$(git describe --tags --abbrev=0)'" -o ~/go/bin/griddriver .
echo build ok

sudo cp ~/go/bin/griddriver /usr/local/bin
Binary file added griddriver/griddriver
Binary file not shown.
8 changes: 5 additions & 3 deletions griddriver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import (
"github.com/urfave/cli"
)

var version string

func main() {
log.SetOutput(io.Discard)
zerolog.SetGlobalLevel(zerolog.Disabled)

app := &cli.App{
Name: "grid",
Usage: "Example: grid [COMMAND]",
Name: "griddriver",
Usage: "Example: grid [COMMAND]",
Version: version,
Commands: []cli.Command{
{
Name: "new-node-cn",
Expand Down

0 comments on commit f03f2c2

Please sign in to comment.