From 6fb1d3e592068faf0adc965a1619dea70c0d054e Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 29 Aug 2023 10:45:48 -0700 Subject: [PATCH] Ensure GNU Awk --- scripts/make-release.sh | 4 +++- scripts/previous-tag.sh | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/make-release.sh b/scripts/make-release.sh index 0bed03c9ac..f1be1c44c0 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -2,6 +2,8 @@ set -e +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + if [[ "$1" = "--status" ]]; then gh workflow view release --repo unisonweb/unison gh workflow view release --repo unisonweb/homebrew-unison @@ -34,7 +36,7 @@ if ! [[ "$1" =~ ^M[0-9]+[a-z]?$ ]] ; then fi version="${1}" -prev_version=$(./scripts/previous-tag.sh "$version") +prev_version=$("${script_dir}/previous-tag.sh" "$version") target=${2:-trunk} tag="release/${version}" diff --git a/scripts/previous-tag.sh b/scripts/previous-tag.sh index fffe3e2953..0f3ed77461 100755 --- a/scripts/previous-tag.sh +++ b/scripts/previous-tag.sh @@ -5,6 +5,11 @@ # ./previous-tag.sh M4a -> M4 # ./previous-tag.sh M4b -> M4a +if ! (awk --version | grep GNU) >/dev/null 2>&1; then + echo "GNU awk is required, install with \`brew install gawk\`" + exit 1 +fi + if ! [[ "$1" =~ ^M[0-9]+[a-z]?$ ]] ; then echo "Version tag must be of the form 'M4' or 'M4a'. E.g." echo "$0 M4a"