From fb82dcf01b3b96ab4c62c7ce0d17b19ef4870283 Mon Sep 17 00:00:00 2001 From: cakemanny Date: Sun, 4 Feb 2024 11:29:14 +0100 Subject: [PATCH] fix release script --- scripts/release.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index dfc0963..ff74756 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -6,7 +6,7 @@ set -o pipefail cd "$(dirname "$0")/.." latest_version() { - fgrep -n '## [' "$1" | grep -o '[0-9]+\.[0-9]+\.[0-9]+' | head -1 + grep -F -n '## [' "$1" | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+' | head -1 } new_version() { @@ -14,11 +14,11 @@ new_version() { unreleased_changes=$(sed -n '/## \[Unreleased/,/^## /p' CHANGELOG.md) - if echo "$unreleased_changes" | fgrep -q '### Added'; then + if echo "$unreleased_changes" | grep -F -q '### Added'; then echo "$latest" | awk -F . '{ print $1 "." ($2 + 1) ".0" }' return fi - if echo "$unreleased_changes" | fgrep -q '### Fixed'; then + if echo "$unreleased_changes" | grep -F -q '### Fixed'; then echo "$latest" | awk -F . '{ print $1 "." $2 "." ($3 + 1) }' return fi @@ -43,11 +43,11 @@ main() { ./scripts/version_changelog # TODO: Adjust for dirtiness - sed -e 's/VERSION = .*/VERSION = "'$v'"/' -i '' setup.py + sed -e 's/VERSION = .*/VERSION = "'"$v"'"/' -i '' setup.py - if [ "$(git rev-parse HEAD)" != "$(git rev-parse HEAD)" ]; then + if [ "$(git rev-parse HEAD)" != "$(git rev-parse master)" ]; then echo "not on master" - exit + exit 1 fi if ! git rev-parse v"$v" 2>/dev/null; then