Skip to content

Commit

Permalink
fix: set ldflags correctly in order to set values for the version com…
Browse files Browse the repository at this point in the history
…mand
  • Loading branch information
trietsch committed Jul 14, 2021
1 parent fb04389 commit 7071aaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X streammachine.io/strm/cmd.Version={{.Version}} -X streammachine.io/strm/cmd.GitSha={{.Commit}} -X streammachine.io/strm/cmd.BuiltOn={{.Date}}
- -s -w -X streammachine.io/strm/pkg/cmd.Version={{.Version}} -X streammachine.io/strm/pkg/cmd.GitSha={{.Commit}} -X streammachine.io/strm/pkg/cmd.BuiltOn={{.Date}}
goos:
- linux
- windows
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targetVar := streammachine.io/strm/pkg/common.RootCommandName

target := dstrm

ldflags := -X '${targetVar}=${target}'
ldflags := -X '${targetVar}=${target}' -X streammachine.io/strm/pkg/cmd.Version=local -X streammachine.io/strm/pkg/cmd.GitSha=local -X streammachine.io/strm/pkg/cmd.BuiltOn=local

dist/${target}: ${source_files} Makefile
go build -ldflags="${ldflags}" -o $@ ./cmd/strm
Expand Down

0 comments on commit 7071aaf

Please sign in to comment.