-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserver.sh
33 lines (28 loc) · 926 Bytes
/
server.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
#! bin/bash
PROD="production"
echo "node env is _$NODE_ENV _ "
cd server;
if [ "$NODE_ENV" = "$PROD" ]; then
echo "==============================="
echo "🔮✨ starting app in production mode 🚀"
echo "==============================="
if [ -d "dist" ]; then
echo "found dist directory, starting server..."
node dist/index.js;
elif ! [ -d "dist" ]; then
echo "no dist folder detected, compiling typescript, and then starting server"
npm run tsc;
node dist/index.js;
fi
elif ! [ "$NODE_ENV" = "$PROD" ]; then
echo "==============================="
echo "🔮✨ starting app in dev mode 🛠"
echo "==============================="
if [ -d "dist" ]; then
echo "found dist directory, starting server..."
npm run concurrently;
elif ! [ -d "dist" ]; then
echo "no dist folder detected, compiling typescript, and then starting server"
npm run concurrently;
fi
fi