-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
executable file
·45 lines (38 loc) · 933 Bytes
/
index.js
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
#!/usr/bin/env node
/* eslint-disable no-undef */
const minimist = require('minimist');
const SketchKit = require('./app/sketch-kit');
function main() {
var argv = minimist(process.argv.slice(2), {string: ['configFile']});
var action = argv._.shift();
var args = argv._;
var context = {
configFile: argv.configFile
}
var s = new SketchKit({
debug: false,
... context
});
switch (action) {
case 'create':
s.create(args);
break;
case 'run':
s.run(args, context);
break;
case 'init':
s.init(args);
break;
case 'build':
s.build(args);
break;
case 'preview':
s.preview(args);
break;
default :
console.log('No Command, will update')
s.update(args);
break;
}
}
main();