From 911d2798cdb291a5781f2c212d4b7561d861b82a Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Sat, 4 Feb 2017 07:02:11 -0800
Subject: [PATCH] Android build wrapper: sometimes quotes hurt you

Shellcheck wanted quotes around "$USE_X" - but that makes the script
fail if you run it without the '-x' argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
 packaging/android/android-build-wrapper.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/packaging/android/android-build-wrapper.sh b/packaging/android/android-build-wrapper.sh
index 523283f35..41e412579 100644
--- a/packaging/android/android-build-wrapper.sh
+++ b/packaging/android/android-build-wrapper.sh
@@ -131,7 +131,11 @@ fi
 rm -f ./subsurface-mobile-build-arm/bin/QtApp-debug.apk
 rm -d ./subsurface-mobile-build-arm/AndroidManifest.xml
 rm -d ./subsurface-mobile-build-arm/bin/AndroidManifest.xml
-bash "$USE_X" subsurface/packaging/android/build.sh "$RELEASE" -buildnr "$BUILDNR" arm "$@"
+if [ "$USE_X" != "" ] ; then
+	bash "$USE_X" subsurface/packaging/android/build.sh "$RELEASE" -buildnr "$BUILDNR" arm "$@"
+else
+	bash subsurface/packaging/android/build.sh "$RELEASE" -buildnr "$BUILDNR" arm "$@"
+fi
 
 ls -l ./subsurface-mobile-build-arm/bin/*.apk