@@ -6,26 +6,26 @@ set -eu -o pipefail
66# before making any changes to the repository
77
88check_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
1919fi
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
2525fi
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
3131fi
@@ -65,15 +65,15 @@ regex='
6565'
6666
6767if [[ ! $changelog =~ $regex ]]; then
68- echo " Could not find date line in change log!"
69- exit 1
68+ echo " Could not find date line in change log!"
69+ exit 1
7070fi
7171
7272version=" ${BASH_REMATCH[1]} "
7373date=" ${BASH_REMATCH[3]} "
74- notes=" $( echo " ${BASH_REMATCH[4]} " | sed -n -E ' /^[0-9]+\.[0-9]+\.[0-9]+/,$!p' ) "
74+ notes=" $( echo " ${BASH_REMATCH[4]} " | sed -n -E ' /^[0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)? /,$!p' ) "
7575
76- if [[ " $date " != $( date +" %Y-%m-%d" ) ]]; then
76+ if [[ " $date " != " $( date +" %Y-%m-%d" ) " ]]; then
7777 echo " $date is not today!"
7878 exit 1
7979fi
138138 popd
139139fi
140140
141-
142141if [ -n " $( git status --porcelain) " ]; then
143142 echo " .gh-pages is not clean" >&2
144143 exit 1
@@ -172,7 +171,7 @@ php phpDocumentor.phar \
172171rm -rf " $cachedir "
173172
174173page=index.md
175- cat << EOF > $page
174+ cat << EOF >$page
176175---
177176layout: default
178177title: minFraud PHP API
@@ -182,14 +181,14 @@ version: $tag
182181
183182EOF
184183
185- cat ../README.md >> $page
184+ cat ../README.md >> $page
186185
187186git add doc/
188187
189188echo " Release notes for $tag :"
190189echo " $notes "
191190
192- read -e -p " Commit changes and push to origin? " should_push
191+ read -r - e -p " Commit changes and push to origin? " should_push
193192
194193if [ " $should_push " != " y" ]; then
195194 echo " Aborting"
@@ -206,5 +205,3 @@ git commit -m "Update for $tag" -a
206205git push
207206
208207gh release create --target " $( git branch --show-current) " -t " $version " -n " $notes " " $tag " " $phar "
209-
210- git push --tags
0 commit comments