mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-11 07:04:26 +02:00
rollup stuff
This commit is contained in:
parent
866749bad5
commit
44322298ba
4 changed files with 35 additions and 3 deletions
|
@ -150,6 +150,13 @@ var Command = Backbone.Model.extend({
|
|||
throw new CommandResult({
|
||||
msg: "Refreshing tree..."
|
||||
});
|
||||
}],
|
||||
[/^rollup (\d+)$/, function(bits) {
|
||||
// go roll up these commands by joining them with semicolons
|
||||
events.trigger('rollupCommands', bits[1]);
|
||||
throw new CommandResult({
|
||||
msg: 'Commands combined!'
|
||||
});
|
||||
}]
|
||||
];
|
||||
},
|
||||
|
@ -164,8 +171,9 @@ var Command = Backbone.Model.extend({
|
|||
// then check if it's one of our sandbox commands
|
||||
_.each(this.getSandboxCommands(), function(tuple) {
|
||||
var regex = tuple[0];
|
||||
if (regex.exec(str)) {
|
||||
tuple[1]();
|
||||
var results = regex.exec(str);
|
||||
if (results) {
|
||||
tuple[1](results);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -181,7 +189,7 @@ var Command = Backbone.Model.extend({
|
|||
// see if begins with git
|
||||
if (str.slice(0,3) !== 'git') {
|
||||
throw new CommandProcessError({
|
||||
msg: 'Git commands only, sorry!'
|
||||
msg: 'That command is not supported, sorry!'
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue