node-ssh
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -170,4 +170,2 @@ 'use strict'; | ||
return new Promise(function (resolve, reject) { | ||
var _this4 = this; | ||
SFTP.fastPut(localFile, remoteFile, function (err) { | ||
@@ -178,4 +176,4 @@ if (!err) { | ||
if (err.message === 'No such file' && retry) { | ||
resolve(_this4.mkdir(Path.dirname(remoteFile)).then(function () { | ||
return _this4.put(localFile, remoteFile, SFTP, false); | ||
resolve(_this3.mkdir(Path.dirname(remoteFile)).then(function () { | ||
return _this3.put(localFile, remoteFile, SFTP, false); | ||
})); | ||
@@ -190,3 +188,3 @@ } else reject(err); | ||
value: function putMulti(files, SFTP) { | ||
var _this5 = this; | ||
var _this4 = this; | ||
@@ -202,3 +200,3 @@ if (!this.connected) { | ||
files.forEach(function (file) { | ||
Promises.push(_this5.put(file.Local, file.Remote, SFTP)); | ||
Promises.push(_this4.put(file.Local, file.Remote, SFTP)); | ||
}); | ||
@@ -222,3 +220,5 @@ return Promise.all(Promises); | ||
SFTP.fastGet(localFile, remoteFile, function (err) { | ||
reject(err); | ||
if (err) { | ||
reject(err); | ||
} else resolve(); | ||
}); | ||
@@ -231,3 +231,3 @@ }); | ||
value: function requestSFTP() { | ||
var _this6 = this; | ||
var _this5 = this; | ||
@@ -238,3 +238,3 @@ if (!this.connected) { | ||
return new Promise(function (resolve, reject) { | ||
_this6.connection.sftp(function (err, sftp) { | ||
_this5.connection.sftp(function (err, sftp) { | ||
if (err) { | ||
@@ -249,3 +249,3 @@ reject(err); | ||
value: function requestShell() { | ||
var _this7 = this; | ||
var _this6 = this; | ||
@@ -256,3 +256,3 @@ if (!this.connected) { | ||
return new Promise(function (resolve, reject) { | ||
_this7.connection.shell(function (err, shell) { | ||
_this6.connection.shell(function (err, shell) { | ||
if (err) { | ||
@@ -259,0 +259,0 @@ reject(err); |
{ | ||
"name": "node-ssh", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "SS2 with Promises", | ||
@@ -5,0 +5,0 @@ "main": "Dist/SSH.js", |
@@ -131,3 +131,3 @@ // @Compiler-Transpile "true" | ||
}).then(SFTP => { | ||
return new Promise(function(resolve, reject) { | ||
return new Promise((resolve, reject) => { | ||
SFTP.fastPut(localFile, remoteFile, (err) => { | ||
@@ -172,4 +172,6 @@ if (!err) { | ||
return new Promise(function(resolve, reject) { | ||
SFTP.fastGet(localFile, remoteFile, (err) => { | ||
reject(err) | ||
SFTP.fastGet(localFile, remoteFile, function(err){ | ||
if (err) { | ||
reject(err) | ||
} else resolve() | ||
}) | ||
@@ -176,0 +178,0 @@ }) |
18684
447