forked from manifoldmarkets/manifold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.sh
executable file
·52 lines (49 loc) · 1.38 KB
/
dev.sh
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
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
ENV=${1:-dev}
PROJECT=$2
case $ENV in
dev)
FIREBASE_PROJECT=dev
NEXT_ENV=DEV ;;
prod)
FIREBASE_PROJECT=prod
NEXT_ENV=PROD ;;
localdb)
echo "WARNING: localdb is deprecated, please use dev instead."
FIREBASE_PROJECT=dev
NEXT_ENV=DEV
EMULATOR=true ;;
*)
echo "Invalid environment; must be dev or prod."
exit 1
esac
DIR=web
if [ "$PROJECT" == "love" ]; then
export IS_MANIFOLD_LOVE=true
DIR=love
echo "Building Manifold.love..."
fi
firebase use $FIREBASE_PROJECT
if [ ! -z $EMULATOR ]
then
npx concurrently \
-n FIRESTORE,API,NEXT,TS \
-c green,white,magenta,cyan \
"yarn --cwd=backend/functions localDbScript" \
"yarn --cwd=backend/api dev" \
"cross-env NEXT_PUBLIC_API_URL=http://localhost:8088
NEXT_PUBLIC_FIREBASE_EMULATE=TRUE \
NEXT_PUBLIC_FIREBASE_ENV=${NEXT_ENV} \
yarn --cwd=${DIR} serve" \
"cross-env yarn --cwd=${DIR} ts-watch"
else
npx concurrently \
-n API,NEXT,TS \
-c white,magenta,cyan \
"cross-env NEXT_PUBLIC_FIREBASE_ENV=${NEXT_ENV} \
yarn --cwd=backend/api dev" \
"cross-env NEXT_PUBLIC_API_URL=http://localhost:8088 \
NEXT_PUBLIC_FIREBASE_ENV=${NEXT_ENV} \
yarn --cwd=${DIR} serve" \
"cross-env yarn --cwd=${DIR} ts-watch"
fi