зеркало из https://github.com/mislav/hub.git
[build] Fix `script/build` when outside of a git repository
Fixes error `usage: link [options] main.o` when building from the downloaded tarball
This commit is contained in:
Родитель
f8e32405fb
Коммит
b4dfe6b0a2
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче