UNPKG

914 BJavaScriptView Raw
1
2
3var print = require('../../utils/print'),
4 argv = require('yargs').argv,
5 gulpServer = require('./server/gulpfile');
6
7var 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
23function helpTitle() {
24 print.title(config);
25}
26
27function helpCommand() {
28 print.command(config);
29}
30
31function 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
43module.exports = {
44 run: run,
45 config: config,
46 helpTitle: helpTitle,
47 helpCommand: helpCommand
48}
\No newline at end of file