mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 06:34:26 +02:00
Move commands/index.js to git/commands.js
This commit is contained in:
parent
1372a8eead
commit
ecbe9cb19a
12 changed files with 1646 additions and 1692 deletions
|
@ -2,7 +2,6 @@ var _ = require('underscore');
|
|||
var intl = require('../intl');
|
||||
|
||||
var GitCommands = require('../git/commands');
|
||||
var Commands = require('../commands');
|
||||
|
||||
var Errors = require('../util/errors');
|
||||
var GitError = Errors.GitError;
|
||||
|
@ -27,7 +26,7 @@ DisabledMap.prototype.getInstantCommands = function() {
|
|||
};
|
||||
|
||||
_.each(this.disabledMap, function(val, disabledCommand) {
|
||||
var gitRegex = Commands.getRegexMap()[disabledCommand];
|
||||
var gitRegex = GitCommands.commands.getRegexMap()[disabledCommand];
|
||||
if (!gitRegex) {
|
||||
throw new Error('wuttttt this disbaled command' + disabledCommand +
|
||||
' has no regex matching');
|
||||
|
|
|
@ -10,7 +10,6 @@ var log = require('../log');
|
|||
var Errors = require('../util/errors');
|
||||
var Sandbox = require('../level/sandbox').Sandbox;
|
||||
var Constants = require('../util/constants');
|
||||
var Commands = require('../commands');
|
||||
|
||||
var Visualization = require('../visuals/visualization').Visualization;
|
||||
var ParseWaterfall = require('../level/parseWaterfall').ParseWaterfall;
|
||||
|
@ -310,8 +309,8 @@ var Level = Sandbox.extend({
|
|||
}
|
||||
|
||||
var matched = false;
|
||||
_.each(Commands.getCommandsThatCount(), function(name) {
|
||||
var regex = Commands.getRegex(name);
|
||||
_.each(GitCommands.commands.getCommandsThatCount(), function(name) {
|
||||
var regex = GitCommands.commands.getRegex(name);
|
||||
matched = matched || regex.test(command.get('rawStr'));
|
||||
});
|
||||
if (matched) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
var _ = require('underscore');
|
||||
|
||||
var GitCommands = require('../git/commands');
|
||||
var Commands = require('../commands');
|
||||
var SandboxCommands = require('../level/sandboxCommands');
|
||||
|
||||
// more or less a static class
|
||||
|
@ -9,7 +8,7 @@ var ParseWaterfall = function(options) {
|
|||
options = options || {};
|
||||
this.options = options;
|
||||
this.shortcutWaterfall = options.shortcutWaterfall || [
|
||||
Commands.getShortcutMap()
|
||||
GitCommands.commands.getShortcutMap()
|
||||
];
|
||||
|
||||
this.instantWaterfall = options.instantWaterfall || [
|
||||
|
|
|
@ -4,7 +4,7 @@ var util = require('../util');
|
|||
var constants = require('../util/constants');
|
||||
var intl = require('../intl');
|
||||
|
||||
var Commands = require('../commands');
|
||||
var GitCommands = require('../git/commands');
|
||||
var Errors = require('../util/errors');
|
||||
var CommandProcessError = Errors.CommandProcessError;
|
||||
var GitError = Errors.GitError;
|
||||
|
@ -121,7 +121,7 @@ var getAllCommands = function() {
|
|||
|
||||
var allCommands = _.extend(
|
||||
{},
|
||||
require('../commands').getRegexMap(),
|
||||
GitCommands.commands.getRegexMap(),
|
||||
require('../level').regexMap,
|
||||
regexMap
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue