From 67ac12969f94de509712967cc8aed6d55f59c6c4 Mon Sep 17 00:00:00 2001 From: jahorton Date: Thu, 19 Sep 2019 12:09:51 +0700 Subject: [PATCH] Minor tweaks to offline mirror script --- ios/build-help.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ios/build-help.sh b/ios/build-help.sh index 6e8f7f8a07..5d004ae4de 100755 --- a/ios/build-help.sh +++ b/ios/build-help.sh @@ -5,14 +5,25 @@ HELP_ROOT=keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources -if [ -z $VERSION ]; then - VERSION="12.0" # Set manually here because alpha versions usually don't have - # matching help yet. +VERSION=`cat ../resources/VERSION.md` + +# If TIER is set to "alpha", use the previous version. Help is usually only updated during +# the "beta" process. +if [ -z $TIER ]; then + # Prevents an error message on the next check. Also, manual runs will likely be during beta. + TIER=beta +fi + +if [ $TIER = "alpha" ]; then + # More readable: (major).minor + [[ "$VERSION" =~ ([0-9]+)\.[0-9]+ ]] + # Construct a decremented version string with .minor set to .0 + $VERSION="$((${BASH_REMATCH[1]}-1)).0" fi # Clear previous help file downloads (if they exist) if [ -d "$HELP_ROOT" ]; then - rm -r "$HELP_ROOT/*" + rm -r "$HELP_ROOT" fi # Create local mirror of the help page subdirectory.