forked from Tencent/wepy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen.sh
More file actions
executable file
·95 lines (62 loc) · 2 KB
/
gen.sh
File metadata and controls
executable file
·95 lines (62 loc) · 2 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
# test wepy new demo
# Start in tasks/ even if run from root directory
cd "$(dirname "$0")"
function cleanup() {
echo 'Cleaning up.'
}
# Error messages are redirected to stderr
function handle_error() {
echo "$(basename $0): ERROR! An error was encountered executing line $1." 1>&2;
cleanup
echo 'Exiting with error.' 1>&2;
exit 1
}
function handle_exit() {
cleanup
echo 'Exiting without error.' 1>&2;
exit
}
# Exit the script with a helpful error message when any error is encountered
trap 'set +x; handle_error $LINENO $BASH_COMMAND' ERR
# Cleanup before exit on any termination signal
trap 'set +x; handle_exit' SIGQUIT SIGTERM SIGINT SIGKILL SIGHUP
# Echo every command being executed
set -x
# Go to root
cd ..
root_path=$PWD
npm link packages/wepy-cli
wepy -v
wepy list
exps="${root_path}/scripts/exps"
for exp in ${exps}/*; do
name=$(basename $exp .exp)
expect "$root_path"/scripts/exps/"$name".exp "/tmp/templates/${name}"
cd "/tmp/templates/${name}"
npm install
node "$root_path"/packages/wepy-cli/bin/wepy.js build
done
# Build multiple version for standard project.
cd /tmp/templates/standard
node "$root_path"/packages/wepy-cli/bin/wepy.js build --output web
node "$root_path"/packages/wepy-cli/bin/wepy.js build --output web --platform qq
node "$root_path"/packages/wepy-cli/bin/wepy.js build --output web --platform wechat
node "$root_path"/packages/wepy-cli/bin/wepy.js build --output ant
# Test build demos
cd /tmp/templates
node "$root_path"/packages/wepy-cli/bin/wepy.js init wepyjs/wepy-wechat-demo wepy-wechat-demo
# git clone https://github.com/wepyjs/wepy-wechat-demo.git
cd wepy-wechat-demo
npm install
node "$root_path"/packages/wepy-cli/bin/wepy.js build
npm run build
cd ..
node "$root_path"/packages/wepy-cli/bin/wepy.js init wepyjs/wepy-weui-demo wepy-weui-demo
# git clone https://github.com/wepyjs/wepy-weui-demo.git
cd wepy-weui-demo
npm install
node "$root_path"/packages/wepy-cli/bin/wepy.js build
npm run build
# Cleanup
cleanup