Skip to content

Commit 7264caa

Browse files
committed
Fix release script consistency issues
1 parent 3a7cdd8 commit 7264caa

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

dev-bin/release.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ set -eu -o pipefail
66
# before making any changes to the repository
77

88
check_command() {
9-
if ! command -v "$1" &> /dev/null; then
9+
if ! command -v "$1" &>/dev/null; then
1010
echo "Error: $1 is not installed or not in PATH"
1111
exit 1
1212
fi
1313
}
1414

1515
# Verify gh CLI is authenticated
16-
if ! gh auth status &> /dev/null; then
16+
if ! gh auth status &>/dev/null; then
1717
echo "Error: gh CLI is not authenticated. Run 'gh auth login' first."
1818
exit 1
1919
fi
2020

2121
# Verify we can access this repository via gh
22-
if ! gh repo view --json name &> /dev/null; then
22+
if ! gh repo view --json name &>/dev/null; then
2323
echo "Error: Cannot access repository via gh. Check your authentication and repository access."
2424
exit 1
2525
fi
2626

2727
# Verify git can connect to the remote (catches SSH key issues, etc.)
28-
if ! git ls-remote origin &> /dev/null; then
28+
if ! git ls-remote origin &>/dev/null; then
2929
echo "Error: Cannot connect to git remote. Check your git credentials/SSH keys."
3030
exit 1
3131
fi
@@ -53,20 +53,20 @@ fi
5353
changelog=$(cat CHANGELOG.md)
5454

5555
regex='
56-
## ([0-9]+\.[0-9]+\.[0-9]+) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
56+
## ([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
5757
5858
((.|
5959
)*)
6060
'
6161

6262
if [[ ! $changelog =~ $regex ]]; then
63-
echo "Could not find date line in change log!"
64-
exit 1
63+
echo "Could not find date line in change log!"
64+
exit 1
6565
fi
6666

6767
version="${BASH_REMATCH[1]}"
68-
date="${BASH_REMATCH[2]}"
69-
notes="$(echo "${BASH_REMATCH[3]}" | sed -n -E '/^## [0-9]+\.[0-9]+\.[0-9]+/,$!p')"
68+
date="${BASH_REMATCH[3]}"
69+
notes="$(echo "${BASH_REMATCH[4]}" | sed -n -E '/^## [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?/,$!p')"
7070
tag="v$version"
7171

7272
if [[ "$date" != "$(date +"%Y-%m-%d")" ]]; then
@@ -85,7 +85,7 @@ echo "$version"
8585
echo $'\nRelease notes:'
8686
echo "$notes"
8787

88-
read -e -p "Push to origin? (y/n) " should_push
88+
read -r -e -p "Push to origin? (y/n) " should_push
8989

9090
if [ "$should_push" != "y" ]; then
9191
echo "Aborting"

0 commit comments

Comments
 (0)