Skip to content

Commit

Permalink
update error
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jul 9, 2014
1 parent c88fdb4 commit 3e2c834
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/sftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ module.exports = function (grunt) {
});

async.eachSeries(files, function (file, callback) {
var srcFiles = options.mode == 'upload' ? grunt.file.expand(options.minimatch, file.src) : file.orig.src;
var srcFiles = options.mode === 'upload' ? grunt.file.expand(options.minimatch, file.src) : file.orig.src;

if (options.mode == 'download') {
if (options.mode === 'download') {
if (srcFiles.length === 0) {
return callback(new Error('Unable to copy; no valid remote files were found.'));
}
Expand All @@ -116,7 +116,7 @@ module.exports = function (grunt) {
if (options.srcBasePath.indexOf(options.path) === 0) {
offsetDirectory = options.srcBasePath.replace(options.path, "");
}
if (file.dest[file.dest.length - 1] == '/') {
if (file.dest[file.dest.length - 1] === '/') {
downloadDest += srcFile.replace(offsetDirectory, "");
}

Expand Down Expand Up @@ -146,7 +146,7 @@ module.exports = function (grunt) {
count--;
count += list.length;
if (!count) {
callback()
callback();
}
list.forEach(function (item) {
downloadingRecursive(path.join(directorySrc, item.filename), path.join(directoryDest, item.filename));
Expand Down Expand Up @@ -179,7 +179,7 @@ module.exports = function (grunt) {
tally.files++;
count--;
if (!count) {
callback()
callback();
}
});
};
Expand Down Expand Up @@ -247,7 +247,7 @@ module.exports = function (grunt) {
}
});
} else {
if (options.mode == 'upload') {
if (options.mode === 'upload') {
if (srcFiles.length === 0) {
return callback(new Error('Unable to copy; no valid source files were found.'));
}
Expand Down

0 comments on commit 3e2c834

Please sign in to comment.