mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-10 20:55:07 +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'),
|
||||
_ = 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 {
|
||||
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user