-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (30 loc) · 933 Bytes
/
Copy pathindex.js
File metadata and controls
39 lines (30 loc) · 933 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
31
32
33
34
35
36
37
38
39
#!/usr/bin/env node
var cliArgs = process.argv.slice(2);
var debug = false;
try {
var fs = require('fs');
debug = fs.existsSync(__dirname + "/debug");
} catch(e) {
debug = false;
}
var Nit = require(__dirname + "/nit.js");
var SpawnRunner = require("spawn_runner");
var runner = new SpawnRunner(debug);
if(cliArgs[0] === "setup"){
var cmd = "cd "+__dirname+" && npm install && sudo npm install -g bower "
+" && cd web/ && npm install && cd public && bower install && cd "+__dirname
+" && cd team/ && npm install && cd public && bower install && cd "+__dirname;
console.log("Running: "+cmd);
child_process = require('child_process');
child_process.exec(cmd, function(err, out, code) {
if (err instanceof Error)
throw err;
process.stdout.write("."+out);
});
} else {
var nit = new Nit();
nit.start(cliArgs, function(){
debug && console.log("All done.");
});
}
module.exports = nit;