[release] fix nullglob issue

This commit is contained in:
Motiejus Jakštys 2021-09-06 15:36:50 +03:00 committed by Motiejus Jakštys
parent ec61d24fd4
commit eab7c3c1ef

View File

@ -9,9 +9,12 @@ err() {
git status --porcelain | grep -q "" && git status --porcelain | grep -q "" &&
err "working tree is dirty, commit your changes first." err "working tree is dirty, commit your changes first."
# https://raimue.blog/2010/09/09/bash-for-loop-with-glob-patterns/
shopt -s nullglob
for file in sha256sum-*; do for file in sha256sum-*; do
err "found $file from previous release, delete it first" err "found $file from previous release, delete it first"
done done
shopt -u nullglob
[[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] || \ [[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] || \
err "arg1 accepts the following formats: v1.0 v1.0.0" err "arg1 accepts the following formats: v1.0 v1.0.0"