From 2571921a68cbc8c6ec3ded599073540796223464 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 1 Nov 2022 08:53:25 +0700 Subject: [PATCH] fix(android): Handle empty release notes --- android/KMAPro/build-play-store-notes.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/android/KMAPro/build-play-store-notes.sh b/android/KMAPro/build-play-store-notes.sh index 6ca9ca0e4b..a3566dbbcd 100755 --- a/android/KMAPro/build-play-store-notes.sh +++ b/android/KMAPro/build-play-store-notes.sh @@ -29,8 +29,15 @@ echo "" > "$PLAY_RELEASE_NOTES" # Copy whatsnew.md to release notes 1 line at a time, # filtering for lines that start with "*". +# Pad release notes if whatsnew.md doesn't have any line items # Play Store release notes have a limit of 500 characters -FILTERED_LINES=`grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md"` +DEFAULT_RELEASE_NOTE="* Additional bug fixes and improvements" +FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches +if [ -z "$FILTERED_LINES" ]; then + FILTERED_LINES="$DEFAULT_RELEASE_NOTE" + warn "Warning: whatsnew.md empty so using default release note: '$FILTERED_LINES'" +fi + IFS=$'\n' # Change IFS to new line for line in $FILTERED_LINES do @@ -42,7 +49,7 @@ do else # 450 chars reached warn "Warning: Play Store release notes approaching 500 character limit" - echo '* Additional bug fixes and improvements' >> $PLAY_RELEASE_NOTES + echo "$DEFAULT_RELEASE_NOTE" >> $PLAY_RELEASE_NOTES break fi done