Fix passing web branch

This commit is contained in:
Vasily
2020-04-14 14:33:27 +03:00
parent dbbf97e588
commit 99e22c499d
19 changed files with 39 additions and 32 deletions

9
build
View File

@@ -81,7 +81,14 @@ if [[ $1 == '-b' || $1 == '--web-branch' ]]; then
web_branch="$2"
shift 2
else
web_branch="$( git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' )"
web_branch="$( git describe --tags --exact-match || true )"
if [[ -z "$web_branch" ]]; then
web_branch="$( git branch 2>/dev/null | grep -v 'HEAD detached' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' )"
if [[ -z "${web_branch}" ]]; then
echo "Cannot determine web branch, pass it explicitly via --web-branch option"
exit 1
fi
fi
fi
# Parse platform option