Comparing version 0.1.0 to 0.1.1
@@ -84,2 +84,11 @@ var fs = require('fs'); | ||
}); | ||
ssh.on('keyboard-interactive', function(name, instructions, instructionsLang, prompts, finish) { | ||
self.emit('keyboard-interactive', name, instructions, instructionsLang, prompts, finish) | ||
}); | ||
ssh.on('change password', function(message, language, done) { | ||
self.emit('change password', message, language, done); | ||
}); | ||
ssh.on('tcp connection', function(details, accept, reject) { | ||
self.emit('tcp connection', details, accept, reject); | ||
}); | ||
ssh.connect(remote); | ||
@@ -148,2 +157,10 @@ this.__ssh = ssh; | ||
} | ||
var length = parseInt((content.length - 1) / 204800, 10) + 1; | ||
var contents = []; | ||
for (var i = 0 ; i < length; i++) { | ||
contents.push(content.slice(i * 204800, (i + 1) * 204800)); | ||
} | ||
var self = this; | ||
@@ -155,6 +172,11 @@ | ||
self.emit('write', options); | ||
sftp.write(handle, content, 0, content.length, 0, function(err) { | ||
var writeErr = err; | ||
var lastIndex = 0; | ||
async.eachSeries(contents, function(content, callback) { | ||
sftp.write(handle, content, 0, content.length, lastIndex, function(err) { | ||
lastIndex += content.length; | ||
callback(err); | ||
}); | ||
}, function(err) { | ||
sftp.close(handle, function(err) { | ||
callback(err || writeErr); | ||
callback(err); | ||
}); | ||
@@ -161,0 +183,0 @@ }); |
{ | ||
"name": "scp2", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A pure javascript scp program based on ssh2.", | ||
@@ -8,9 +8,13 @@ "author": "Hsiaoming Yang <lepture@me.com>", | ||
"keywords": [ | ||
"ssh", "scp", "copy", "remote", "ssh2" | ||
"ssh", | ||
"scp", | ||
"copy", | ||
"remote", | ||
"ssh2" | ||
], | ||
"dependencies": { | ||
"ssh2": "~0.1.13", | ||
"glob": "~3.1.21", | ||
"ssh2": "~0.2.5", | ||
"glob": "~3.2.1", | ||
"async": "~0.2.6", | ||
"lodash": "~1.0.1" | ||
"lodash": "~1.2.1" | ||
}, | ||
@@ -17,0 +21,0 @@ "repository": { |
@@ -191,2 +191,6 @@ # scp2 | ||
**2013-06-03** `0.1.1` ~stable | ||
1. Bugfix for scp a large file. | ||
**2013-03-08** `0.1.0` ~ stable | ||
@@ -193,0 +197,0 @@ |
Sorry, the diff of this file is not supported yet
19831
335
244
+ Addedasn1@0.1.11(transitive)
+ Addedglob@3.2.11(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedlodash@1.2.1(transitive)
+ Addedminimatch@0.3.0(transitive)
+ Addedssh2@0.2.25(transitive)
+ Addedstreamsearch@0.1.2(transitive)
- Removedglob@3.1.21(transitive)
- Removedgraceful-fs@1.2.3(transitive)
- Removedinherits@1.0.2(transitive)
- Removedlodash@1.0.2(transitive)
- Removedminimatch@0.2.14(transitive)
- Removedssh2@0.1.13(transitive)
Updatedglob@~3.2.1
Updatedlodash@~1.2.1
Updatedssh2@~0.2.5