UNPKG

954 BJavaScriptView Raw
1/**
2 * @Author: songqi
3 * @Date: 2017-01-10
4 * @Last modified by: songqi
5 * @Last modified time: 2017-03-23
6 */
7
8var print = require('../../utils/print'),
9 argv = require('yargs').argv,
10 gulpServer = require('./server/gulpfile');
11
12var 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
28function helpTitle() {
29 print.title(config);
30}
31
32function helpCommand() {
33 print.command(config);
34}
35
36function run() {
37 if (argv.h || argv.help) {
38 helpCommand();
39 } else {
40 gulpServer.start('weex');
41 }
42}
43
44module.exports = {
45 run: run,
46 config: config,
47 helpTitle: helpTitle,
48 helpCommand: helpCommand
49}
\No newline at end of file