mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-04 09:00:13 +00:00
extract is cloned executor method
This commit is contained in:
parent
9a8bd90855
commit
5a6a440d11
@ -4,7 +4,6 @@ var Steppy = require('twostep').Steppy,
|
|||||||
path = require('path'),
|
path = require('path'),
|
||||||
_ = require('underscore'),
|
_ = require('underscore'),
|
||||||
EventEmitter = require('events').EventEmitter,
|
EventEmitter = require('events').EventEmitter,
|
||||||
fs = require('fs'),
|
|
||||||
inherits = require('util').inherits;
|
inherits = require('util').inherits;
|
||||||
|
|
||||||
function Executor(params) {
|
function Executor(params) {
|
||||||
@ -97,14 +96,11 @@ Executor.prototype._getChanges = function(params, callback) {
|
|||||||
scm, isFirstRun, oldRev;
|
scm, isFirstRun, oldRev;
|
||||||
Steppy(
|
Steppy(
|
||||||
function() {
|
function() {
|
||||||
var slot = this.slot();
|
self._isCloned(this.slot());
|
||||||
fs.exists(self.cwd, function(exists) {
|
|
||||||
slot(null, exists);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
function(err, exists) {
|
function(err, cloned) {
|
||||||
var scmParams = {type: params.type};
|
var scmParams = {type: params.type};
|
||||||
if (exists) {
|
if (cloned) {
|
||||||
scmParams.cwd = self.cwd;
|
scmParams.cwd = self.cwd;
|
||||||
isFirstRun = false;
|
isFirstRun = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -5,6 +5,7 @@ var Steppy = require('twostep').Steppy,
|
|||||||
ParentExecutor = require('./base').Executor,
|
ParentExecutor = require('./base').Executor,
|
||||||
createScm = require('../scm').createScm,
|
createScm = require('../scm').createScm,
|
||||||
createCommand = require('../command').createCommand,
|
createCommand = require('../command').createCommand,
|
||||||
|
fs = require('fs'),
|
||||||
_ = require('underscore');
|
_ = require('underscore');
|
||||||
|
|
||||||
function Executor(params) {
|
function Executor(params) {
|
||||||
@ -22,3 +23,9 @@ Executor.prototype._createScm = function(params) {
|
|||||||
Executor.prototype._createCommand = function(params) {
|
Executor.prototype._createCommand = function(params) {
|
||||||
return createCommand(params);
|
return createCommand(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Executor.prototype._isCloned = function(callback) {
|
||||||
|
fs.exists(this.cwd, function(exists) {
|
||||||
|
callback(null, exists);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user