-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathci-script.js
More file actions
executable file
·48 lines (39 loc) · 1.09 KB
/
ci-script.js
File metadata and controls
executable file
·48 lines (39 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env node
/**
* Created by WindomZ on 17-7-3.
*/
'use strict';
const os = require('os');
const prog = require('caporal');
const init = require('./init');
const shell = require('./shell');
const pkg = require('./package.json');
prog.version(pkg.version).description(pkg.description);
prog.argument('[directory]', 'The workspace directory').action(argv => {
let dir = argv['directory'] || '';
process.stdout.write('>>> ci-script start...' + os.EOL);
shell
.exec(dir)
.then(() => {
process.stdout.write('>>> ci-script complete!' + os.EOL);
})
.catch(e => {
process.stderr.write(e.message);
});
});
prog
.command('init', 'init...')
.argument('[directory]', 'The workspace directory', prog.STRING)
.action(argv => {
let dir = argv['directory'] || '';
process.stdout.write('>>> ci-script init start...' + os.EOL);
init
.initConfig(dir)
.then(() => {
process.stdout.write('>>> ci-script init complete!' + os.EOL);
})
.catch(e => {
process.stderr.write(e.message);
});
});
prog.parse(process.argv);