mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
generate-version: handle git repo not having any tags
This commit is contained in:
parent
dfd9590931
commit
7d30bccad8
2 changed files with 8 additions and 6 deletions
|
|
@ -13,7 +13,14 @@ out_file=${3}
|
|||
if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then
|
||||
workdir=$(pwd)
|
||||
cd "${src_dir}"
|
||||
git_version=$(git describe --always --tags)
|
||||
|
||||
if git describe --tags > /dev/null 2>&1; then
|
||||
git_version=$(git describe --always --tags)
|
||||
else
|
||||
# No tags available, happens in e.g. CI builds
|
||||
git_version="${default_version}"
|
||||
fi
|
||||
|
||||
git_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
cd "${workdir}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue