mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 02:05:09 +00:00
exports commands and scms with single name
This commit is contained in:
parent
e78b39af29
commit
6cce9c9bbf
@ -8,7 +8,7 @@ function Command(params) {
|
|||||||
this.isEmit = params.isEmit;
|
this.isEmit = params.isEmit;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.BaseCommand = Command;
|
exports.Command = Command;
|
||||||
|
|
||||||
inherits(Command, EventEmitter);
|
inherits(Command, EventEmitter);
|
||||||
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var typesHash = {
|
|
||||||
'shell': require('./shell').ShellCommand
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.createCommand = function(params) {
|
exports.createCommand = function(params) {
|
||||||
var Constructor = typesHash[params.type];
|
var Constructor = require('./' + params.type).Command;
|
||||||
return new Constructor(params);
|
return new Constructor(params);
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ParentCommand = require('./spawn').SpawnCommand,
|
var ParentCommand = require('./spawn').Command,
|
||||||
inherits = require('util').inherits;
|
inherits = require('util').inherits;
|
||||||
|
|
||||||
function Command(params) {
|
function Command(params) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var spawn = require('child_process').spawn,
|
var spawn = require('child_process').spawn,
|
||||||
ParentCommand = require('./base').BaseCommand,
|
ParentCommand = require('./base').Command,
|
||||||
inherits = require('util').inherits;
|
inherits = require('util').inherits;
|
||||||
|
|
||||||
function Command(params) {
|
function Command(params) {
|
||||||
@ -10,7 +10,7 @@ function Command(params) {
|
|||||||
this.cwd = params.cwd;
|
this.cwd = params.cwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.SpawnCommand = Command;
|
exports.Command = Command;
|
||||||
|
|
||||||
inherits(Command, ParentCommand);
|
inherits(Command, ParentCommand);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ParentCommand = require('../command/spawn').SpawnCommand,
|
var ParentCommand = require('../command/spawn').Command,
|
||||||
inherits = require('util').inherits;
|
inherits = require('util').inherits;
|
||||||
|
|
||||||
function Scm(params) {
|
function Scm(params) {
|
||||||
@ -11,7 +11,7 @@ function Scm(params) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.BaseScm = Scm;
|
exports.Scm = Scm;
|
||||||
|
|
||||||
inherits(Scm, ParentCommand);
|
inherits(Scm, ParentCommand);
|
||||||
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var typesHash = {
|
|
||||||
'mercurial': require('./mercurial').MercurialScm
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.createScm = function(params) {
|
exports.createScm = function(params) {
|
||||||
var Constructor = typesHash[params.type];
|
var Constructor = require('./' + params.type).Scm;
|
||||||
return new Constructor(params);
|
return new Constructor(params);
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ParentScm = require('./base').BaseScm,
|
var ParentScm = require('./base').Scm,
|
||||||
inherits = require('util').inherits;
|
inherits = require('util').inherits;
|
||||||
|
|
||||||
function Scm(params) {
|
function Scm(params) {
|
||||||
ParentScm.call(this, params);
|
ParentScm.call(this, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.MercurialScm = Scm;
|
exports.Scm = Scm;
|
||||||
|
|
||||||
inherits(Scm, ParentScm);
|
inherits(Scm, ParentScm);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ var expect = require('expect.js'),
|
|||||||
path = require('path'),
|
path = require('path'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
createScm = require('../lib/scm').createScm,
|
createScm = require('../lib/scm').createScm,
|
||||||
SpawnCommand = require('../lib/command/spawn').SpawnCommand;
|
SpawnCommand = require('../lib/command/spawn').Command;
|
||||||
|
|
||||||
|
|
||||||
['mercurial'].forEach(function(type) {
|
['mercurial'].forEach(function(type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user