extract is cloned executor method

This commit is contained in:
oleg 2016-02-26 23:58:46 +03:00
parent 9a8bd90855
commit 5a6a440d11
2 changed files with 10 additions and 7 deletions

View File

@ -4,7 +4,6 @@ var Steppy = require('twostep').Steppy,
path = require('path'),
_ = require('underscore'),
EventEmitter = require('events').EventEmitter,
fs = require('fs'),
inherits = require('util').inherits;
function Executor(params) {
@ -97,14 +96,11 @@ Executor.prototype._getChanges = function(params, callback) {
scm, isFirstRun, oldRev;
Steppy(
function() {
var slot = this.slot();
fs.exists(self.cwd, function(exists) {
slot(null, exists);
});
self._isCloned(this.slot());
},
function(err, exists) {
function(err, cloned) {
var scmParams = {type: params.type};
if (exists) {
if (cloned) {
scmParams.cwd = self.cwd;
isFirstRun = false;
} else {

View File

@ -5,6 +5,7 @@ var Steppy = require('twostep').Steppy,
ParentExecutor = require('./base').Executor,
createScm = require('../scm').createScm,
createCommand = require('../command').createCommand,
fs = require('fs'),
_ = require('underscore');
function Executor(params) {
@ -22,3 +23,9 @@ Executor.prototype._createScm = function(params) {
Executor.prototype._createCommand = function(params) {
return createCommand(params);
};
Executor.prototype._isCloned = function(callback) {
fs.exists(this.cwd, function(exists) {
callback(null, exists);
});
};