From cc2f145fc2d8ab298159fc9555ddbf80c26eff55 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 1 Jul 2023 12:32:04 -0700 Subject: [PATCH] deal better with unset variable --- xwords4/android/scripts/arelease.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xwords4/android/scripts/arelease.sh b/xwords4/android/scripts/arelease.sh index 75f4ebf25..11fabddd0 100755 --- a/xwords4/android/scripts/arelease.sh +++ b/xwords4/android/scripts/arelease.sh @@ -7,12 +7,17 @@ FILES="" LIST_FILE='' XW_WWW_PATH=${XW_WWW_PATH:-""} XW_RELEASE_SCP_DEST=${XW_RELEASE_SCP_DEST:-""} +VARIANT="" usage() { echo "Error: $*" >&2 echo "usage: $0 [--tag ] [--apk-list path/to/out.txt] \\" echo " --variant " echo " []" >&2 + echo "Here are some possible variants:" + for VAR in $(./gradlew tasks | grep assembleXw4 | awk '{print $1}' | sed -e 's/assemble//'); do + echo " $VAR" + done exit 1 } @@ -58,7 +63,9 @@ if [ -n "$TAGNAME" ]; then git stash fi -if [ -z "$FILES" ]; then +if [ -z "$VARIANT" ]; then + usage "--variant not optional" +elif [ -z "$FILES" ]; then do_build for f in $(ls $(dirname $0)/../app/build/outputs/apk/*/release/*-release-unsigned-*.apk); do $(dirname $0)/sign-align.sh --apk $f