Skip to content

Commit 74879b7

Browse files
committed
Fix release script consistency issues
- Quote date command substitution for defensive programming - Apply shfmt formatting
1 parent d5a578d commit 74879b7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dev-bin/release.sh

Lines changed: 9 additions & 9 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
@@ -62,15 +62,15 @@ regex='
6262
'
6363

6464
if [[ ! $changelog =~ $regex ]]; then
65-
echo "Could not find date line in change log!"
66-
exit 1
65+
echo "Could not find date line in change log!"
66+
exit 1
6767
fi
6868

6969
version="${BASH_REMATCH[1]}"
7070
date="${BASH_REMATCH[2]}"
7171
notes="$(echo "${BASH_REMATCH[3]}" | sed -n -e '/^[0-9]\+\.[0-9]\+\.[0-9]\+/,$!p')"
7272

73-
if [[ "$date" != $(date +"%Y-%m-%d") ]]; then
73+
if [[ "$date" != "$(date +"%Y-%m-%d")" ]]; then
7474
echo "$date is not today!"
7575
exit 1
7676
fi
@@ -119,7 +119,7 @@ if [ "$should_continue" != "y" ]; then
119119
fi
120120

121121
page=.gh-pages/index.md
122-
cat <<EOF > $page
122+
cat <<EOF >$page
123123
---
124124
layout: default
125125
title: MaxMind DB Java API
@@ -134,7 +134,7 @@ mvn versions:set -DnewVersion="$version"
134134
perl -pi -e "s/(?<=<version>)[^<]*/$version/" README.md
135135
perl -pi -e "s/(?<=com\.maxmind\.db\:maxmind-db\:)\d+\.\d+\.\d+([\w\-]+)?/$version/" README.md
136136

137-
cat README.md >> $page
137+
cat README.md >>$page
138138

139139
git diff
140140

0 commit comments

Comments
 (0)