Skip to content

Commit

Permalink
support --version using -X
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Sep 15, 2024
1 parent 9bbc87b commit 9d02301
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: -X main.version=${{ github.ref }}
overwrite: true
md5sum: false
sha256sum: false
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/fiatjaf/cli/v3"
)

var version string = "debug"

var app = &cli.Command{
Name: "nak",
Suggest: true,
Expand All @@ -27,6 +29,7 @@ var app = &cli.Command{
bunker,
serve,
},
Version: version,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "quiet",
Expand Down

0 comments on commit 9d02301

Please sign in to comment.