-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
49 lines (40 loc) · 849 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
46
47
48
49
var argv = require('yargs').argv;
var harp = require('harp');
var rsync = require('rsyncwrapper').rsync;
var util = require('util');
global.moment = require('moment');
global._ = require('underscore');
var build = function() {
util.log('Compiling...');
harp.compile('.', './www', function(err) {
if (err) {
util.log('Compile failed with errors:');
util.log(err);
} else {
util.log('Compile completed without errors');
}
});
};
var serve = function() {
var port = argv.port || '9000';
console.log('Serving on port 9000');
harp.server('.', {
port: port
});
};
var deploy = function() {
};
switch (argv._[0]) {
case 'serve':
serve();
break;
case 'build':
build();
break;
case 'deploy':
deploy();
break;
default:
util.log('No command specified.');
break;
}