nci/lib/executor/local.js

36 lines
860 B
JavaScript
Raw Permalink Normal View History

'use strict';
var Steppy = require('twostep').Steppy,
inherits = require('util').inherits,
ParentExecutor = require('./base').Executor,
createScm = require('../scm').createScm,
createCommand = require('../command').createCommand,
2016-02-26 20:58:46 +00:00
fs = require('fs'),
path = require('path'),
2016-02-28 19:13:24 +00:00
SpawnCommand = require('../command/spawn').Command;
function Executor(params) {
ParentExecutor.call(this, params);
this.cwd = path.join(this.project.dir, 'workspace');
}
inherits(Executor, ParentExecutor);
exports.Executor = Executor;
2015-06-28 07:47:06 +00:00
Executor.prototype._createScm = function(params) {
2016-02-28 19:13:24 +00:00
params.command = new SpawnCommand();
2015-06-28 07:47:06 +00:00
return createScm(params);
};
Executor.prototype._createCommand = function(params) {
return createCommand(params);
};
2016-02-26 20:58:46 +00:00
Executor.prototype._isCloned = function(callback) {
fs.exists(this.cwd, function(exists) {
callback(null, exists);
});
};