-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsimulator.sh
More file actions
executable file
·42 lines (34 loc) · 873 Bytes
/
simulator.sh
File metadata and controls
executable file
·42 lines (34 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
if [[ $# = 0 ]]; then
echo "Usage: $0 Scheme-Name Debug/Release"
exit 1
fi
TS_FILE="./scripts/validate-env.ts"
if command -v ts-node >/dev/null 2>&1; then
TS_NODE_PATH="ts-node"
else
echo "ts-node not found. Installing ts-node locally..."
yarn add -D ts-node
TS_NODE_PATH="./node_modules/.bin/ts-node"
fi
$TS_NODE_PATH "$TS_FILE"
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "An error occurred while executing validate-env.ts"
echo "Exiting..."
exit 1
fi
if [[ $USE_RN_CLI = true ]]; then
echo "Using react-native-cli"
react-native run-ios --scheme $1 --mode $2 ${@:3}
exit 0
else
# check if expo is in node_modules
if [ ! -d "./node_modules/expo" ]; then
echo "expo not found. Installing expo locally..."
yarn add -D expo
fi
echo "Using expo-cli"
expo run:ios --scheme $1 --configuration $2 ${@:3}
exit 0
fi