From eab7c3c1efd2919eb81f6df089390a3b77b15e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 6 Sep 2021 15:36:50 +0300 Subject: [PATCH] [release] fix nullglob issue --- release | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release b/release index 2e1c2b0..38659e8 100755 --- a/release +++ b/release @@ -9,9 +9,12 @@ err() { git status --porcelain | grep -q "" && 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 err "found $file from previous release, delete it first" done +shopt -u nullglob [[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] || \ err "arg1 accepts the following formats: v1.0 v1.0.0"