mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
more progress
This commit is contained in:
parent
5e2bace639
commit
01fb9ec25b
3 changed files with 47 additions and 32 deletions
|
@ -11171,15 +11171,8 @@ var Command = Backbone.Model.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// then check if shortcut exists, and replace, but
|
str = GitCommands.expandShortcut(str);
|
||||||
// preserve options if so
|
this.set('rawStr', str);
|
||||||
_.each(GitCommands.getShortcutMap(), function(regex, method) {
|
|
||||||
var results = regex.exec(str);
|
|
||||||
if (results) {
|
|
||||||
str = method + ' ' + str.slice(results[0].length);
|
|
||||||
}
|
|
||||||
this.set('rawStr', str);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
// see if begins with git
|
// see if begins with git
|
||||||
if (str.slice(0,3) !== 'git') {
|
if (str.slice(0,3) !== 'git') {
|
||||||
|
@ -11327,7 +11320,9 @@ exports.Command = Command;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
require.define("/src/js/git/commands.js",function(require,module,exports,__dirname,__filename,process,global){var getRegexMap = function() {
|
require.define("/src/js/git/commands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||||
|
|
||||||
|
var getRegexMap = function() {
|
||||||
return {
|
return {
|
||||||
// ($|\s) means that we either have to end the string
|
// ($|\s) means that we either have to end the string
|
||||||
// after the command or there needs to be a space for options
|
// after the command or there needs to be a space for options
|
||||||
|
@ -11356,8 +11351,18 @@ var getShortcutMap = function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var expandShortcut = function(commandStr) {
|
||||||
|
_.each(getShortcutMap(), function(regex, method) {
|
||||||
|
var results = regex.exec(commandStr);
|
||||||
|
if (results) {
|
||||||
|
commandStr = method + ' ' + commandStr.slice(results[0].length);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return commandStr;
|
||||||
|
};
|
||||||
|
|
||||||
exports.getRegexMap = getRegexMap;
|
exports.getRegexMap = getRegexMap;
|
||||||
exports.getShortcutMap = getShortcutMap;
|
exports.expandShortcut = expandShortcut;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -14110,7 +14115,9 @@ exports.init = init;
|
||||||
});
|
});
|
||||||
require("/src/js/app/index.js");
|
require("/src/js/app/index.js");
|
||||||
|
|
||||||
require.define("/src/js/git/commands.js",function(require,module,exports,__dirname,__filename,process,global){var getRegexMap = function() {
|
require.define("/src/js/git/commands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||||
|
|
||||||
|
var getRegexMap = function() {
|
||||||
return {
|
return {
|
||||||
// ($|\s) means that we either have to end the string
|
// ($|\s) means that we either have to end the string
|
||||||
// after the command or there needs to be a space for options
|
// after the command or there needs to be a space for options
|
||||||
|
@ -14139,8 +14146,18 @@ var getShortcutMap = function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var expandShortcut = function(commandStr) {
|
||||||
|
_.each(getShortcutMap(), function(regex, method) {
|
||||||
|
var results = regex.exec(commandStr);
|
||||||
|
if (results) {
|
||||||
|
commandStr = method + ' ' + commandStr.slice(results[0].length);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return commandStr;
|
||||||
|
};
|
||||||
|
|
||||||
exports.getRegexMap = getRegexMap;
|
exports.getRegexMap = getRegexMap;
|
||||||
exports.getShortcutMap = getShortcutMap;
|
exports.expandShortcut = expandShortcut;
|
||||||
|
|
||||||
});
|
});
|
||||||
require("/src/js/git/commands.js");
|
require("/src/js/git/commands.js");
|
||||||
|
@ -16349,15 +16366,8 @@ var Command = Backbone.Model.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// then check if shortcut exists, and replace, but
|
str = GitCommands.expandShortcut(str);
|
||||||
// preserve options if so
|
this.set('rawStr', str);
|
||||||
_.each(GitCommands.getShortcutMap(), function(regex, method) {
|
|
||||||
var results = regex.exec(str);
|
|
||||||
if (results) {
|
|
||||||
str = method + ' ' + str.slice(results[0].length);
|
|
||||||
}
|
|
||||||
this.set('rawStr', str);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
// see if begins with git
|
// see if begins with git
|
||||||
if (str.slice(0,3) !== 'git') {
|
if (str.slice(0,3) !== 'git') {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
var _ = require('underscore');
|
||||||
|
|
||||||
var getRegexMap = function() {
|
var getRegexMap = function() {
|
||||||
return {
|
return {
|
||||||
// ($|\s) means that we either have to end the string
|
// ($|\s) means that we either have to end the string
|
||||||
|
@ -27,5 +29,15 @@ var getShortcutMap = function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var expandShortcut = function(commandStr) {
|
||||||
|
_.each(getShortcutMap(), function(regex, method) {
|
||||||
|
var results = regex.exec(commandStr);
|
||||||
|
if (results) {
|
||||||
|
commandStr = method + ' ' + commandStr.slice(results[0].length);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return commandStr;
|
||||||
|
};
|
||||||
|
|
||||||
exports.getRegexMap = getRegexMap;
|
exports.getRegexMap = getRegexMap;
|
||||||
exports.getShortcutMap = getShortcutMap;
|
exports.expandShortcut = expandShortcut;
|
||||||
|
|
|
@ -194,15 +194,8 @@ var Command = Backbone.Model.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// then check if shortcut exists, and replace, but
|
str = GitCommands.expandShortcut(str);
|
||||||
// preserve options if so
|
this.set('rawStr', str);
|
||||||
_.each(GitCommands.getShortcutMap(), function(regex, method) {
|
|
||||||
var results = regex.exec(str);
|
|
||||||
if (results) {
|
|
||||||
str = method + ' ' + str.slice(results[0].length);
|
|
||||||
}
|
|
||||||
this.set('rawStr', str);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
// see if begins with git
|
// see if begins with git
|
||||||
if (str.slice(0,3) !== 'git') {
|
if (str.slice(0,3) !== 'git') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue