Skip to content

Commit

Permalink
Merge pull request #56 from maboiteaspam/create_remote_root_jit
Browse files Browse the repository at this point in the history
add missing mkdir before the transfer begins
  • Loading branch information
thrashr888 committed Jan 14, 2015
2 parents 4f52763 + 6a617ff commit 711d69a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions tasks/sftp-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,24 +334,29 @@ module.exports = function(grunt) {
var locations = _.keys(toTransfer);
// console.dir(locations);


// Iterating through all location from the `localRoot` in parallel
async.forEachSeries(locations, sftpProcessDirectories, function(err) {
grunt.verbose.writeln(' ');
log.ok('Directories done.');
has_transferred_all_files = false;

if( err ) done_handler(err);
sftp.mkdir(remoteRoot, {mode: 0755}, function(err) {
// ignore err to not block if dir already exists
// if( err ) return done_handler(err);

// Iterating through all location from the `localRoot` in parallel
async.forEachLimit(getFiles(toTransfer), concurrency, sftpPut, function (err) {
// console.log('callback');
has_transferred_all_files = true;
done_handler(err);
async.forEachSeries(locations, sftpProcessDirectories, function(err) {
grunt.verbose.writeln(' ');
log.ok('Directories done.');
has_transferred_all_files = false;

if( err ) done_handler(err);

// Iterating through all location from the `localRoot` in parallel
async.forEachLimit(getFiles(toTransfer), concurrency, sftpPut, function (err) {
// console.log('callback');
has_transferred_all_files = true;
done_handler(err);
});
});

});

});

});

if (grunt.errors) {
Expand Down

0 comments on commit 711d69a

Please sign in to comment.