mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 18:46:17 +00:00
do not set default command for scm
This commit is contained in:
parent
f721de039d
commit
baceedd70e
@ -6,7 +6,7 @@ var Steppy = require('twostep').Steppy,
|
|||||||
createScm = require('../scm').createScm,
|
createScm = require('../scm').createScm,
|
||||||
createCommand = require('../command').createCommand,
|
createCommand = require('../command').createCommand,
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
_ = require('underscore');
|
SpawnCommand = require('../command/spawn').Command;
|
||||||
|
|
||||||
function Executor(params) {
|
function Executor(params) {
|
||||||
ParentExecutor.call(this, params);
|
ParentExecutor.call(this, params);
|
||||||
@ -17,6 +17,8 @@ inherits(Executor, ParentExecutor);
|
|||||||
exports.Executor = Executor;
|
exports.Executor = Executor;
|
||||||
|
|
||||||
Executor.prototype._createScm = function(params) {
|
Executor.prototype._createScm = function(params) {
|
||||||
|
params.command = new SpawnCommand();
|
||||||
|
|
||||||
return createScm(params);
|
return createScm(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ function Scm(params) {
|
|||||||
|
|
||||||
self.command = params.command;
|
self.command = params.command;
|
||||||
|
|
||||||
|
if (!self.command) throw new Error('`command` is required');
|
||||||
|
|
||||||
self.command.setParams({
|
self.command.setParams({
|
||||||
collectOut: true,
|
collectOut: true,
|
||||||
emitIn: true,
|
emitIn: true,
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var SpawnCommand = require('../command/spawn').Command;
|
|
||||||
|
|
||||||
exports.createScm = function(params) {
|
exports.createScm = function(params) {
|
||||||
var Constructor = require('./' + params.type).Scm;
|
var Constructor = require('./' + params.type).Scm;
|
||||||
|
|
||||||
params.command = params.command || new SpawnCommand();
|
|
||||||
|
|
||||||
return new Constructor(params);
|
return new Constructor(params);
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,8 @@ var expect = require('expect.js'),
|
|||||||
it('create scm instance attached to new repository without errors', function() {
|
it('create scm instance attached to new repository without errors', function() {
|
||||||
scm = createScm({
|
scm = createScm({
|
||||||
type: type,
|
type: type,
|
||||||
repository: originalRepositoryPath
|
repository: originalRepositoryPath,
|
||||||
|
command: new SpawnCommand()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -129,7 +130,11 @@ var expect = require('expect.js'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('create scm instance attached to existing `cwd` without errors', function() {
|
it('create scm instance attached to existing `cwd` without errors', function() {
|
||||||
scm = createScm({type: type, cwd: repositoryPath});
|
scm = createScm({
|
||||||
|
type: type,
|
||||||
|
cwd: repositoryPath,
|
||||||
|
command: new SpawnCommand()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('expect repository log from rev0 to default revision equals to ' +
|
it('expect repository log from rev0 to default revision equals to ' +
|
||||||
|
Loading…
Reference in New Issue
Block a user