version: handle whitespace in ${mod_version} (#141)

5ca195b109 changed the shell code
to determine the OSS module version:
-mod_version=${go_list##* }
+mod_version=${go_list#tailscale.com}

The intent is fine but the original code also consumed a whitespace
from the go.mod content:
        tailscale.com v1.52.0
original: "v1.52.0"
updated:  " v1.52.0"

At least for me, "make tag_release" no longer works:
    error: pathspec ' v1.54.0' did not match any file(s) known to git
Note the extra space at the start of the pathspec.

It is apparently not broken for everyone, possibly related to
versions of other tools I have installed like maybe git.

I don't want to just put the whitespace trimming back the way it
was, that seems fragile. Instead, quote ${mod_version} in a way
which won't be sensitive to extra whitespace.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
release-branch/1.54
Denton Gentry 1 year ago committed by GitHub
parent 318065c64f
commit 33a2eb0dee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,7 @@ cd $tailscale_clone
git reset --hard -q
git clean -d -x -f
git fetch -q --all --tags
git checkout -q "$mod_version"
git checkout -q ${mod_version}
eval $(./build_dist.sh shellvars)
git_hash=$(git rev-parse HEAD)

Loading…
Cancel
Save