From 5ca195b1097fad0b750e1ac04bdd49ed3313c123 Mon Sep 17 00:00:00 2001 From: James Tucker Date: Mon, 31 Jul 2023 17:58:20 -0700 Subject: [PATCH] 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 --- version/tailscale-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version/tailscale-version.sh b/version/tailscale-version.sh index e8d3529..df75a5c 100755 --- a/version/tailscale-version.sh +++ b/version/tailscale-version.sh @@ -11,10 +11,10 @@ set -euo pipefail go_list=$(go list -m tailscale.com) # go list outputs `tailscale.com `. 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