forked from gear-tech/gear-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgear-js.sh
executable file
·40 lines (35 loc) · 907 Bytes
/
gear-js.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
#!/bin/sh
command="$1"
pkg="$2"
SQUID_TYPEORM_MIGRATION_BIN="node_modules/.bin/squid-typeorm-migration"
SQUID_PATH="idea/squid"
EXPLORER_PATH="idea/explorer"
if [ "$command" == "install" ]; then
echo "Installing dependencies"
yarn install
elif [ "$command" == "build" ]; then
echo "Building $pkg"
yarn build:$pkg
elif [ "$command" = "run" ]; then
echo "Running squid"
case $pkg in
"squid")
cd $SQUID_PATH
if [ -f "$SQUID_TYPEORM_MIGRATION_BIN" ]; then
node $SQUID_TYPEORM_MIGRATION_BIN apply
else
node ../../$SQUID_TYPEORM_MIGRATION_BIN apply
fi
node lib/main.js
;;
"explorer")
cd $EXPLORER_PATH
node dist/main.js
;;
*)
echo "Invalid package"
;;
esac
else
echo "Invalid command"
fi