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