From b4dfe6b0a2f7692d27d3e92deb9babb0a844b24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 21 Jan 2020 15:25:40 +0100 Subject: [PATCH] [build] Fix `script/build` when outside of a git repository Fixes error `usage: link [options] main.o` when building from the downloaded tarball --- script/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version b/script/version index d7c5a2a6..bc43d4d8 100755 --- a/script/version +++ b/script/version @@ -11,7 +11,7 @@ export GIT_CEILING_DIRECTORIES=${PWD%/*} version="$(git describe --tags HEAD 2>/dev/null || true)" if [ -z "$version" ]; then - version="$(grep Version version/version.go | head -1 | cut -d '"' -f2)" + version="$(grep 'Version =' version/version.go | head -1 | cut -d '"' -f2)" sha="$(git rev-parse --short HEAD 2>/dev/null || true)" [ -z "$sha" ] || version="${version}-g${sha}" fi