release: fix release tag check

We should make sure ${tag} fully matches otherwise we cannot
differentiate `1.3.0` vs. `1.3.0-rc1`, nor `1.3.0` vs. `11.3.0`.

Fixes: #196

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao 2018-09-27 18:26:53 +08:00
parent 6613fc58b3
commit f4feba9a9f

View File

@ -144,8 +144,8 @@ create_github_release() {
repo_dir=${1:-}
tag=${2:-}
[ -d "${repo_dir}" ] || die "No repository directory"
[ -n "${tag}" ] || die "No repository directory"
if ! "${hub_bin}" release | grep "${tag}"; then
[ -n "${tag}" ] || die "No tag specified"
if ! "${hub_bin}" release | grep -q "^${tag}$"; then
info "Creating Github release"
"${hub_bin}" -C "${repo_dir}" release create -m "${PROJECT} ${tag}" "${tag}"
else