-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
33 lines (30 loc) · 876 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
var repo_url = '[email protected]:codingforinterviews/cfi_tests.git';
var repo_path = process.env['HOME']+'/.cfi';
(function () {
//Logic for executing the file
var args = process.argv.splice(2);
var git = require('./git.js');
switch(args[0]) {
case 'list':
var list = require('./list.js').list(repo_path);
git.maintainRepo(repo_path,repo_url,list);
break;
case 'test':
if(args.length!=3) {
//Not enough/too many parameters. Reprint help test
console.error("Not the correct number of parameters");
process.exit(1);
}
var testName = args[1];
var program = args[2];
var test = require('./test.js').test(repo_path,testName,program);
git.maintainRepo(repo_path,repo_url,test);
break;
default:
console.log('other');
break;
}
}).call(this);
//help prints help information to stdout
function help() {
}