1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var print = require('../../utils/print'),
|
9 | argv = require('yargs').argv,
|
10 | gulpServer = require('./server/gulpfile');
|
11 |
|
12 | var config = {
|
13 | name: 'build',
|
14 | explain: 'build for eros project.',
|
15 | command: 'eros build',
|
16 | options: [{
|
17 | keys: ['-h', '--help'],
|
18 | describe: 'read help.'
|
19 | }, {
|
20 | keys: ['-s', '--send'],
|
21 | describe: 'pack production zip and send to server.'
|
22 | }, {
|
23 | keys: ['-d', '--diff'],
|
24 | describe: 'generate diff zip.'
|
25 | }]
|
26 | }
|
27 |
|
28 | function helpTitle() {
|
29 | print.title(config);
|
30 | }
|
31 |
|
32 | function helpCommand() {
|
33 | print.command(config);
|
34 | }
|
35 |
|
36 | function run() {
|
37 | if (argv.h || argv.help) {
|
38 | helpCommand();
|
39 | } else {
|
40 | gulpServer.start('weex');
|
41 | }
|
42 | }
|
43 |
|
44 | module.exports = {
|
45 | run: run,
|
46 | config: config,
|
47 | helpTitle: helpTitle,
|
48 | helpCommand: helpCommand
|
49 | } |
\ | No newline at end of file |