Skip to content

Commit

Permalink
Merge pull request #4291 from unisonweb/cp/fix-release-script
Browse files Browse the repository at this point in the history
Warn on invalid awk version
  • Loading branch information
ChrisPenner authored Aug 29, 2023
2 parents 04ba01c + 6fb1d3e commit 2382948
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"

Expand Down
5 changes: 5 additions & 0 deletions scripts/previous-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2382948

Please sign in to comment.