summaryrefslogtreecommitdiff
path: root/bin/downloadExpoApp.sh
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-14 15:10:31 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-14 15:10:31 +0200
commite5021187e96b78b53203bd95d08d6818aea47d17 (patch)
tree37ec45d00eb963db53cd4bb4f04a770414b351cc /bin/downloadExpoApp.sh
New Ignite 7.0.6 app
Diffstat (limited to 'bin/downloadExpoApp.sh')
-rwxr-xr-xbin/downloadExpoApp.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/downloadExpoApp.sh b/bin/downloadExpoApp.sh
new file mode 100755
index 0000000..1a7904a
--- /dev/null
+++ b/bin/downloadExpoApp.sh
@@ -0,0 +1,30 @@
+#!/bin/bash -e
+
+set -euo pipefail
+
+# based on https://github.com/yaron1m/expo-detox-typescript-example/blob/master/scripts/dl_expo_bins
+APP_PATH=./bin/Exponent.app
+
+if [ ! -d $APP_PATH ]; then
+ echo "First time running Detox -- downloading Expo client app"
+
+ # Sanity check
+ if [ ! -f "package.json" ]; then
+ echo "Oops - run this command from your project's root folder" >>/dev/stderr
+ exit 1
+ fi
+
+ # Make the app dir (this'll also make sure we already have the bin directory)
+ mkdir $APP_PATH
+
+ # query expo.io to find most recent ipaUrl
+ IPA_URL=`curl --silent --show-error https://expo.io/--/api/v2/versions | python -c 'import sys, json; print json.load(sys.stdin)["iosUrl"]'`
+
+ # download tar.gz
+ TMP_PATH=./exponent.tar.gz
+ curl --silent --show-error --output $TMP_PATH $IPA_URL
+
+ # unzip tar.gz into APP_PATH
+ tar -C $APP_PATH -xzf $TMP_PATH
+ rm ./exponent.tar.gz
+fi