1 | #!/usr/bin/env bash
|
2 |
|
3 | if [ -d "./node_modules/@bxjs/base" ]; then
|
4 |
|
5 | source ./node_modules/@bxjs/base/cmd.sh
|
6 | else
|
7 |
|
8 | echo 'ERROR!请在项目根目录下执行命令!'
|
9 | exit -1
|
10 | fi
|
11 |
|
12 |
|
13 | ROOT=$PWD
|
14 | cd $ROOT
|
15 | rm -rf $ROOT/dist
|
16 | mkdir -p $ROOT/dist/target
|
17 | ./node_modules/typescript/bin/tsc
|
18 | if [ $? != 0 ]; then
|
19 | echo 'make error'
|
20 | exit
|
21 | fi
|
22 |
|
23 |
|
24 | cp -rvf app package.json package-lock.json tsconfig.json $ROOT/dist/target
|
25 | cp -rvf ./node_modules/@bxjs/base/global.d.ts $ROOT/dist/target
|
26 |
|
27 | cd $ROOT/dist/target
|
28 | npm install --production
|
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 | rm -rf `find $ROOT/dist -name package\-lock.json | xargs`
|
58 |
|
59 |
|
60 | rm -rf `find $ROOT/dist -name bin | xargs`
|
61 | rm -rf `find $ROOT/dist -name .bin | xargs`
|
62 | rm -rf `find $ROOT/dist -name \*.ts | xargs`
|
63 | rm -rf `find $ROOT/dist -name \*.md | xargs`
|
64 | rm -rf `find $ROOT/dist -name \*.markdown | xargs`
|
65 | rm -rf `find $ROOT/dist -name \*LICENSE\* | xargs`
|
66 | rm -rf `find $ROOT/dist -name \*license\* | xargs`
|
67 | rm -rf `find $ROOT/dist -name \*CopyrightNotice\* | xargs`
|
68 | rm -rf `find $ROOT/dist -name .npmignore | xargs`
|
69 | rm -rf `find $ROOT/dist -name .travis.yml | xargs`
|
70 | rm -rf `find $ROOT/dist -name .jshintrc | xargs`
|
71 | rm -rf `find $ROOT/dist -name .editorconfig | xargs`
|
72 | rm -rf `find $ROOT/dist -name .gitattributes | xargs`
|
73 | rm -rf `find $ROOT/dist -name .eslintrc | xargs`
|
74 | rm -rf `find $ROOT/dist -name .coveralls.yml | xargs`
|
75 | rm -rf `find $ROOT/dist -name AUTHORS | xargs`
|
76 |
|
77 | rm -rf `find $ROOT/dist/target/node_modules -name doc | xargs`
|
78 | rm -rf `find $ROOT/dist/target/node_modules -name docs | xargs`
|
79 | rm -rf `find $ROOT/dist/target/node_modules -name fonts | xargs`
|
80 | rm -rf `find $ROOT/dist/target/node_modules -name test | xargs`
|
81 | rm -rf `find $ROOT/dist/target/node_modules -name tests | xargs`
|
82 | rm -rf `find $ROOT/dist/target/node_modules -name example | xargs`
|
83 | rm -rf `find $ROOT/dist/target/node_modules -name examples | xargs`
|
84 | rm -rf `find $ROOT/dist/target/node_modules -name benchmark | xargs`
|
85 | rm -rf `find $ROOT/dist/target/node_modules -name \*samples\* | xargs`
|
86 | rm -rf `find $ROOT/dist/target/node_modules -name @types | xargs`
|
87 | rm -rf `find $ROOT/dist/target/node_modules -name demo | xargs`
|
88 | rm -rf `find $ROOT/dist/target/node_modules -name typings | xargs`
|
89 | rm -rf `find $ROOT/dist/target/node_modules -name Makefile | xargs`
|
90 | rm -rf `find $ROOT/dist/target/node_modules -name \*.debug.js | xargs`
|
91 | rm -rf `find $ROOT/dist/target/node_modules -name \*.min.js | xargs`
|
92 | rm -rf `find $ROOT/dist/target/node_modules -name locales | xargs`
|
93 | rm -rf `find $ROOT/dist/target/node_modules -name completion.sh* | xargs`
|
94 | rm -rf `find $ROOT/dist/target/node_modules -name appveyor.yml | xargs`
|
95 | rm -rf `find $ROOT/dist/target/node_modules -name codecov.yml | xargs`
|
96 | rm -rf `find $ROOT/dist/target/node_modules -name bower.json | xargs`
|
97 | rm -rf `find $ROOT/dist/target/node_modules -name Gruntfile.js | xargs`
|
98 | rm -rf `find $ROOT/dist/target/node_modules -name karma.conf.js | xargs`
|
99 | rm -rf `find $ROOT/dist/target/node_modules -name yarn.lock | xargs`
|
100 | rm -rf `find $ROOT/dist/target/node_modules -name \*.sh | xargs`
|
101 | rm -rf `find $ROOT/dist/target/node_modules -name \*ChangeLog\* | xargs`
|
102 | rm -rf `find $ROOT/dist/target/node_modules -name \*babelrc\* | xargs`
|
103 | rm -rf `find $ROOT/dist/target/node_modules -name \*eslint\* | xargs`
|
104 | rm -rf `find $ROOT/dist/target/node_modules -name \*tslint\* | xargs`
|
105 | rm -rf `find $ROOT/dist/target/node_modules -name \*.png\* | xargs`
|
106 | rm -rf `find $ROOT/dist/target/node_modules -name \*.webpack.config.js\* | xargs`
|
107 | rm -rf `find $ROOT/dist/target/node_modules -name \*.coffee\* | xargs`
|
108 | rm -rf `find $ROOT/dist/target/node_modules -name \*.h | xargs`
|
109 | rm -rf `find $ROOT/dist/target/node_modules -name CHANGELOG | xargs`
|
110 | rm -rf `find $ROOT/dist/target/node_modules -name .idea | xargs`
|
111 | rm -rf `find $ROOT/dist/target/node_modules -name .zuul.yml | xargs`
|
112 | rm -rf `find $ROOT/dist/target/node_modules -name \*TODO\* | xargs`
|
113 | rm -rf `find $ROOT/dist/target/node_modules -name \*.patch\* | xargs`
|
114 | rm -rf $ROOT/dist/target/node_modules/ramda/es
|
115 | rm -rf $ROOT/dist/target/node_modules/protobufjs/cli
|
116 | rm -rf $ROOT/dist/target/node_modules/protobufjs/docs
|
117 | rm -rf $ROOT/dist/target/node_modules/protobufjs/scripts
|
118 | rm -rf $ROOT/dist/target/node_modules/protobufjs/jsdoc.json
|
119 | rm -rf $ROOT/dist/target/node_modules/protobufjs/*.png
|
120 | rm -rf $ROOT/dist/target/node_modules/inversify/amd
|
121 | rm -rf $ROOT/dist/target/node_modules/inversify/es
|
122 | rm -rf $ROOT/dist/target/node_modules/inversify/dts
|
123 | rm -rf $ROOT/dist/target/node_modules/fsevents
|
124 |
|
125 |
|
126 | echo "console.setLogLevel('error'); console.log = console.error; exports.handler = require('@bxjs/base/framework/index').handler" > ./index.js
|
127 | zip -q -9 -r $ROOT/dist/target.zip *
|
128 |
|
129 |
|
130 | rm -rf `find $ROOT/app -name \*.js | xargs`
|
131 | rm -rf `find $ROOT/test -name \*.js | xargs`
|
132 | cd $ROOT
|