From dc32493a38ca44ab8a097ec7d33c2df0806fc21e Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 11 Oct 2019 18:07:04 +0200 Subject: [PATCH] [Wallet] Add script to build sdk for env before running yarn dev --- packages/mobile/package.json | 1 + packages/mobile/scripts/pre-dev.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100755 packages/mobile/scripts/pre-dev.sh diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 4ffbc087179..484436de104 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -15,6 +15,7 @@ "build:ts": "tsc --noEmit", "build:metro": "echo 'NOT WORKING RIGHT NOW'", "build:gen-graphql-types": "gql-gen --schema http://localhost:8080/graphql --template graphql-codegen-typescript-template --out ./typings/ 'src/**/*.tsx'", + "predev": "./scripts/pre-dev.sh", "dev": "react-native run-android --appIdSuffix \"debug\"", "dev:show-menu": "adb devices | grep '\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} adb -s {} shell input keyevent 82", "dev:clear-data": "adb shell pm clear org.celo.mobile.debug", diff --git a/packages/mobile/scripts/pre-dev.sh b/packages/mobile/scripts/pre-dev.sh new file mode 100755 index 00000000000..13cdea50861 --- /dev/null +++ b/packages/mobile/scripts/pre-dev.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +# ==================================== +# Tasks to run before running yarn dev +# ==================================== + +# Detect network from .env and build the sdk for it +export $(grep -v '^#' .env | xargs) +echo "Building sdk for testnet $DEFAULT_TESTNET" +yarn build:sdk $DEFAULT_TESTNET +echo "Done building sdk" \ No newline at end of file