Skip to content

Commit

Permalink
修复 jsftp 的一个 bug,参见 sergi/jsftp#138
Browse files Browse the repository at this point in the history
  • Loading branch information
qiu8310 committed Sep 19, 2015
1 parent 096a394 commit 7933c8d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,16 @@ require('./')(dir, globPatterns, opts, function(err, all) {

if (program.homeLog) {
var daLogDir = path.join(path.homedir(), '.da_log');
var d = new Date();
var s = ['FullYear', 'Month', 'Date', 'Hours', 'Minutes', 'Seconds'].map(function (k) {
var v = d['get' + k]();
if (k === 'Month') v += 1;
v = new String(v);
if (v.length < 2) v = '0' + v;
return v;
});
fs.ensureDirSync(daLogDir);
write(path.join(daLogDir, Date.now() + '.log.json'), logMap);
write(path.join(daLogDir, s.join('-') + '.log.json'), logMap);
}

if (program.mapLocalPath) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"commander": "^2.8.0",
"fs-extra": "^0.18.2",
"glob": "^5.0.5",
"jsftp": "^1.5.2",
"jsftp": "qiu8310/jsftp",
"lodash": "^3.7.0",
"mime": "^1.3.4",
"mkdirp": "^0.5.0",
Expand Down
1 change: 1 addition & 0 deletions src/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Uploader(opts) {
* @type {Boolean}
*/
this.enableBatchUpload = false;

}


Expand Down
2 changes: 1 addition & 1 deletion src/uploaders/ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function FtpUploader(opts) {

self.port = opts.port || 21;

log.info('Create ftp');
self.ftp = new FTP({host: self.host, user: self.user, pass: self.pass, port: self.port});

self.baseUrl = self.normalizeBaseUrl(opts.baseUrl);
Expand Down Expand Up @@ -129,7 +130,6 @@ FtpUploader.prototype.batchUploadFiles = function(files, cb) {
self.endFtp();
return cb(err);
}

async.eachSeries(
files,
function (file, done) {
Expand Down

0 comments on commit 7933c8d

Please sign in to comment.