diff options
author | Jakob Unterwurzacher | 2020-10-03 22:47:12 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-10-04 00:12:46 +0200 |
commit | fe340477b2471ed03510339ca51bfcc396b03040 (patch) | |
tree | 15fce4da6da568ea572fbc54a85a17bbb8947ec6 | |
parent | 754c48387038f78ac653bcc7e97582e1491cfbd9 (diff) |
build.bash: show "go mod edit -replace" in version string
If you do something like this,
go mod edit -replace github.com/hanwen/go-fuse/v2=/home/jakob/go/src/github.com/hanwen/go-fuse
the version string of the resulting binary should reflect that.
Before:
gocryptfs v1.8.0-135-g352b547-dirty.gofuse_v2api; go-fuse v2.0.4-0.20200908172753-0b6cbc515082; 2020-10-03 go1.15.2 linux/amd64
After:
gocryptfs v1.8.0-135-g352b547-dirty.gofuse_v2api; go-fuse v2.0.4-0.20200908172753-0b6cbc515082 => /home/jakob/go/src/github.com/hanwen/go-fuse; 2020-10-03 go1.15.2 linux/amd64
-rwxr-xr-x | build.bash | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -42,7 +42,7 @@ if [[ -d vendor/github.com/hanwen/go-fuse ]] ; then else # go-fuse version according to Go Modules FAIL=0 - OUT=$(go list -m github.com/hanwen/go-fuse/v2 | cut -d' ' -f2) || FAIL=1 + OUT=$(go list -m github.com/hanwen/go-fuse/v2 | cut -d' ' -f2-) || FAIL=1 if [[ $FAIL -eq 0 ]]; then GITVERSIONFUSE=$OUT else @@ -84,7 +84,7 @@ if [[ -z ${GOFLAGS:-} ]] ; then export GOFLAGS fi -GO_LDFLAGS="-X main.GitVersion=$GITVERSION -X main.GitVersionFuse=$GITVERSIONFUSE -X main.BuildDate=$BUILDDATE" +GO_LDFLAGS="-X \"main.GitVersion=$GITVERSION\" -X \"main.GitVersionFuse=$GITVERSIONFUSE\" -X \"main.BuildDate=$BUILDDATE\"" # If LDFLAGS is set, add it as "-extldflags". if [[ -n ${LDFLAGS:-} ]] ; then |