tool/go: accept a marker file with no line terminator

Somewhere my local configuration or program versions are producing
marker files earlier in the process that lack a line terminator. This
doesn't need to cause an exit via set -e, we can just continue the
process. $extracted matches $REV anyway, so the process works.

Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
James Tucker 2022-07-25 15:46:39 -07:00 committed by James Tucker
parent df9f3edea3
commit 7b1a91dfd3
1 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,9 @@ get_cached() {
archive="$TOOLCHAIN-$REV.tar.gz"
mark="$TOOLCHAIN.extracted"
extracted=
[ ! -e "$mark" ] || read -r extracted junk <$mark
# Ignore the error from read, which may error if the mark file does not contain a line end.
read -r extracted < "$mark" || true
if [ "$extracted" = "$REV" ] && [ -e "${TOOLCHAIN_GO}" ]; then
# already ok