forked from AElfProject/aelf-web-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
44 lines (33 loc) · 836 Bytes
/
build.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
#!/bin/bash
cat << EOT
_ _____ _ __
/ \ | ____| |/ _|
/ _ \ | _| | | |_
/ ___ \| |___| | _|
/_/ \_\_____|_|_|
EOT
#当变量a为null或为空字符串时则var=b
start_mode=${1:-'production'}
node_modules_action=${2:-'default'}
echo ${node_modules_action} ${start_mode}
git checkout package-lock.json
git pull && echo "git pull done"
if [ ${node_modules_action} = 'reinstall' ]
then
echo 'npm install'
npm install && echo 'install done'
sleep 3
npm install && echo 'install check done'
sleep 3
fi
echo 'running webpack'
if [ ${start_mode} = 'dev' ]
then
npm run build:dev && echo 'webpack done'
npm run dev
echo 'npm run dev'
else
npm run build && echo 'webpack done'
npm stop && npm start
echo 'npm stop && npm start'
fi