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