mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-10 21:05:09 +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,
|
||||
createCommand = require('../command').createCommand,
|
||||
fs = require('fs'),
|
||||
_ = require('underscore');
|
||||
SpawnCommand = require('../command/spawn').Command;
|
||||
|
||||
function Executor(params) {
|
||||
ParentExecutor.call(this, params);
|
||||
@ -17,6 +17,8 @@ inherits(Executor, ParentExecutor);
|
||||
exports.Executor = Executor;
|
||||
|
||||
Executor.prototype._createScm = function(params) {
|
||||
params.command = new SpawnCommand();
|
||||
|
||||
return createScm(params);
|
||||
};
|
||||
|
||||
|
@ -18,6 +18,8 @@ function Scm(params) {
|
||||
|
||||
self.command = params.command;
|
||||
|
||||
if (!self.command) throw new Error('`command` is required');
|
||||
|
||||
self.command.setParams({
|
||||
collectOut: true,
|
||||
emitIn: true,
|
||||
|
@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var SpawnCommand = require('../command/spawn').Command;
|
||||
|
||||
exports.createScm = function(params) {
|
||||
var Constructor = require('./' + params.type).Scm;
|
||||
|
||||
params.command = params.command || new SpawnCommand();
|
||||
|
||||
return new Constructor(params);
|
||||
};
|
||||
|
@ -42,7 +42,8 @@ var expect = require('expect.js'),
|
||||
it('create scm instance attached to new repository without errors', function() {
|
||||
scm = createScm({
|
||||
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() {
|
||||
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 ' +
|
||||
|
Loading…
Reference in New Issue
Block a user