mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-17 17:23:41 +02:00
Resolves #593 -- add alias support with local storage
This commit is contained in:
parent
a1f7bda2d9
commit
12cdb49457
3 changed files with 55 additions and 2 deletions
|
@ -8,6 +8,7 @@ var Errors = require('../util/errors');
|
|||
var CommandProcessError = Errors.CommandProcessError;
|
||||
var LocaleStore = require('../stores/LocaleStore');
|
||||
var LocaleActions = require('../actions/LocaleActions');
|
||||
var LevelStore = require('../stores/LevelStore');
|
||||
var GlobalStateStore = require('../stores/GlobalStateStore');
|
||||
var GlobalStateActions = require('../actions/GlobalStateActions');
|
||||
var GitError = Errors.GitError;
|
||||
|
@ -50,6 +51,21 @@ var instantCommands = [
|
|||
msg: lines.join('\n')
|
||||
});
|
||||
}],
|
||||
[/^alias (\w+)="(.+)"$/, function(bits) {
|
||||
const alias = bits[1];
|
||||
const expansion = bits[2];
|
||||
LevelStore.addToAliasMap(alias, expansion);
|
||||
throw new CommandResult({
|
||||
msg: 'Set alias "'+alias+'" to "'+expansion+'"',
|
||||
});
|
||||
}],
|
||||
[/^unalias (\w+)$/, function(bits) {
|
||||
const alias = bits[1];
|
||||
LevelStore.removeFromAliasMap(alias);
|
||||
throw new CommandResult({
|
||||
msg: 'Removed alias "'+alias+'"',
|
||||
});
|
||||
}],
|
||||
[/^locale (\w+)$/, function(bits) {
|
||||
LocaleActions.changeLocale(bits[1]);
|
||||
throw new CommandResult({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue