1 | var ae86 = require('./ae86'),
|
2 | bag = require('bagofcli');
|
3 |
|
4 | function _init() {
|
5 | console.log('Creating example AE86 project');
|
6 | new ae86().init(bag.exit);
|
7 | }
|
8 |
|
9 | function _gen(args) {
|
10 | args = args || {};
|
11 | console.log('Generating website');
|
12 | new ae86({ outDir: args.outDir }).generate(bag.exit);
|
13 | }
|
14 |
|
15 | function _watch(args) {
|
16 | args = args || {};
|
17 | console.log('Watching for changes and automatically regenerating website');
|
18 | new ae86({ outDir: args.outDir }).watch(bag.exit);
|
19 | }
|
20 |
|
21 | function _clean(args) {
|
22 | args = args || {};
|
23 | console.log('Removing website');
|
24 | new ae86({ outDir: args.outDir }).clean(bag.exit);
|
25 | }
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | function exec() {
|
31 |
|
32 | var actions = {
|
33 | commands: {
|
34 | init: { action: _init },
|
35 | gen: { action: _gen },
|
36 | watch: { action: _watch },
|
37 | drift: { action: _watch },
|
38 | clean: { action: _clean }
|
39 | }
|
40 | };
|
41 |
|
42 | bag.command(__dirname, actions);
|
43 | }
|
44 |
|
45 | exports.exec = exec; |
\ | No newline at end of file |