mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
slowly moving git command logic out of command model
This commit is contained in:
parent
bbdaa37abd
commit
5e2bace639
7 changed files with 246 additions and 115 deletions
31
src/js/git/commands.js
Normal file
31
src/js/git/commands.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
var getRegexMap = function() {
|
||||
return {
|
||||
// ($|\s) means that we either have to end the string
|
||||
// after the command or there needs to be a space for options
|
||||
commit: /^commit($|\s)/,
|
||||
add: /^add($|\s)/,
|
||||
checkout: /^checkout($|\s)/,
|
||||
rebase: /^rebase($|\s)/,
|
||||
reset: /^reset($|\s)/,
|
||||
branch: /^branch($|\s)/,
|
||||
revert: /^revert($|\s)/,
|
||||
log: /^log($|\s)/,
|
||||
merge: /^merge($|\s)/,
|
||||
show: /^show($|\s)/,
|
||||
status: /^status($|\s)/,
|
||||
'cherry-pick': /^cherry-pick($|\s)/
|
||||
};
|
||||
};
|
||||
|
||||
var getShortcutMap = function() {
|
||||
return {
|
||||
'git commit': /^gc($|\s)/,
|
||||
'git add': /^ga($|\s)/,
|
||||
'git checkout': /^go($|\s)/,
|
||||
'git rebase': /^gr($|\s)/,
|
||||
'git branch': /^gb($|\s)/
|
||||
};
|
||||
};
|
||||
|
||||
exports.getRegexMap = getRegexMap;
|
||||
exports.getShortcutMap = getShortcutMap;
|
Loading…
Add table
Add a link
Reference in a new issue