Skip to content

Commit fc58ba2

Browse files
committed
Fix option handling in github-release.sh
* Don't accept -b: it is ignored. * Fail on long options other than "notes" * Fix syntax error in "notes" handling (&& can't appear in a [ ... ])
1 parent 166fdc2 commit fc58ba2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

github-release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function exec_or_dry_run() {
2626
PUSH_CHANGES=true
2727

2828
notesFile=""
29-
while getopts 'dhb:-:' opt; do
29+
while getopts 'dh-:' opt; do
3030
if [ "$opt" = "-" ]; then
3131
# long option: reformulate opt and OPTARG
3232
# - extract long option name
@@ -54,7 +54,7 @@ while getopts 'dhb:-:' opt; do
5454
notesFile="$OPTARG"
5555
echo "Using external notes-file : $notesFile"
5656
;;
57-
\?)
57+
*)
5858
usage
5959
exit 1
6060
;;
@@ -130,7 +130,7 @@ releaseName="Hibernate ${PROJECT_NAME} ${RELEASE_VERSION}"
130130

131131
# determine the main body of the release notes..
132132
notesContent=""
133-
if [ -n $notesFile && -f $notesFile ]; then
133+
if [ -n "$notesFile" -a -f "$notesFile" ]; then
134134
# a notes file was passed to the script - read its contents as the main content
135135
notesContent=$(cat "$notesFile")
136136
else

0 commit comments

Comments
 (0)