version: fix result from tailscale-version.sh when not using a git source (#117)

If the developer has used `go mod vendor` or `go work use ../tailscale`
then the version script was returning "tailscale.com" instead of hitting
the error case.

This now makes the outcome with the Makefile slightly worse, which needs
to be fixed up next.

Updates #cleanup
raggi/tailscale-version-workspace
James Tucker 9 months ago committed by GitHub
parent 31f2aa8097
commit 5ca195b109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,10 +11,10 @@ set -euo pipefail
go_list=$(go list -m tailscale.com)
# go list outputs `tailscale.com <version>`. Extract the version.
mod_version=${go_list##* }
mod_version=${go_list#tailscale.com}
if [ -z "$mod_version" ]; then
echo "no version reported by go list -m tailscale.com: $go_list"
echo >&2 "no version reported by go list -m tailscale.com: $go_list"
exit 1
fi

Loading…
Cancel
Save