-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
31 lines (24 loc) · 748 Bytes
/
cli.js
File metadata and controls
31 lines (24 loc) · 748 Bytes
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
#!/usr/bin/env node
var program = require('commander');
var statixConfig = require(process.cwd() + '/statix.config.js');
var Statix = require(process.cwd() + '/node_modules/statix').Statix;
var throwNoCommandNotice = true;
program
.version('0.0.1')
program
.command('server')
.action(function() {
throwNoCommandNotice = false;
var statix = new Statix(statixConfig).server();
});
program
.command('build')
.action(function() {
throwNoCommandNotice = false;
statixConfig.useFileWatch = false;
var statix = new Statix(statixConfig).build();
});
program.parse(process.argv);
if (throwNoCommandNotice === true) {
console.log("Please provided a command server, or build")
}