-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorc.js
More file actions
73 lines (61 loc) · 1.81 KB
/
orc.js
File metadata and controls
73 lines (61 loc) · 1.81 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var app = require('commander');
var git = require('gitty');
var path = require('path');
// process.stdin.resume();
// process.stdin.setEncoding('utf8');
// process.stdin.on('data', function(data) {
// process.stdout.write(data);
// });
process.on('SIGINT', function () {
console.log('Got a SIGINT. Goodbye cruel world');
process.exit(0);
});
function _requireCommit() {
}
function checkpoint() {
}
function pull() {
// TODO
}
function push() {
// TODO
}
function branch() {
// TODO
}
function status() {
// TODO: incomplete, just an example
/*
{ staged:
[ { file: '../package.json',
status: 'new file' } ],
unstaged:
[ { file: '../.gitignore',
status: 'modified' },
{ file: '../package.json',
status: 'modified' } ],
untracked: [ 'orc-test.js' ] }
*/
r = new git.Repo('.', {}, function(err, repo) {
if(err) {
console.log('error getting repo status');
return;
}
repo.status(function(err, stats){
console.log('stats: '+JSON.stringify(stats));
});
});
}
app.command('checkpoint').alias('cp').description('commit all local changes and push to repo. use this all the time!').action(checkpoint);
app.command('pull').description('pull latest from remote master into your current branch').action(pull);
app.command('push').description("use this when you're ready to submit a pull request on github: squash your branch down to one commit, run unit tests, and push.").action(push);
app.command('branch').description('helper for switching branches').action(branch);
app.command('status').alias('st').description('helper for getting status').action(status); // REMOVE
exports.checkpoint = checkpoint;
exports.pull = pull;
exports.push = push;
exports.branch = branch;
exports.main = function() {
p = app.parse(process.argv);
console.log('main! '+JSON.stringify(process.argv));
};