Fix version not being set properly during build.

Closes #170.

This release will be backported and 0.4.4 re-released.
This commit is contained in:
Will Rouesnel 2018-03-21 00:27:00 +11:00
parent c82c0eb9e1
commit 4df26a0922
1 changed files with 1 additions and 1 deletions

View File

@ -627,7 +627,7 @@ func makeBuilder(cmd string, platform Platform) func() error {
fmt.Println("Building", platform.PlatformBin(cmd)) fmt.Println("Building", platform.PlatformBin(cmd))
return sh.RunWith(map[string]string{"CGO_ENABLED": "0", "GOOS": platform.OS, "GOARCH": platform.Arch}, return sh.RunWith(map[string]string{"CGO_ENABLED": "0", "GOOS": platform.OS, "GOARCH": platform.Arch},
"go", "build", "-a", "-ldflags", fmt.Sprintf("-extldflags '-static' -X version.Version=%s", version), "go", "build", "-a", "-ldflags", fmt.Sprintf("-extldflags '-static' -X main.Version=%s", version),
"-o", platform.PlatformBin(cmd), cmdSrc) "-o", platform.PlatformBin(cmd), cmdSrc)
} }
return f return f