Socket
Socket
Sign inDemoInstall

node-ssh

Package Overview
Dependencies
11
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

1

lib/helpers.js

@@ -37,3 +37,2 @@ 'use strict';

}
config.password = password;
}

@@ -40,0 +39,0 @@ return config;

43

lib/index.js

@@ -108,2 +108,4 @@ 'use strict';

var _ref3 = _asyncToGenerator(function* (path) {
var _this2 = this;
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'sftp';

@@ -120,11 +122,24 @@ var givenSftp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

} else {
(0, _assert2.default)(!givenSftp || (typeof givenSftp === 'undefined' ? 'undefined' : _typeof(givenSftp)) === 'object', 'sftp must be an object');
var sftp = givenSftp || (yield this.requestSFTP());
try {
yield Helpers.mkdirSftp(path, sftp);
} finally {
if (!givenSftp) {
sftp.end();
yield* function* () {
(0, _assert2.default)(!givenSftp || (typeof givenSftp === 'undefined' ? 'undefined' : _typeof(givenSftp)) === 'object', 'sftp must be an object');
var sftp = givenSftp || (yield _this2.requestSFTP());
var makeSftpDirectory = function makeSftpDirectory(retry) {
return Helpers.mkdirSftp(path, sftp).catch(function (error) {
if (retry && error && error.message === 'No such file') {
return _this2.mkdir(_path2.default.dirname(path), 'sftp', sftp).then(function () {
return makeSftpDirectory(false);
});
}
throw error;
});
};
try {
yield makeSftpDirectory(true);
} finally {
if (!givenSftp) {
sftp.end();
}
}
}
}();
}

@@ -261,3 +276,3 @@ });

if (error.message === 'No such file' && retry) {
resolve(that.mkdir(_path2.default.dirname(remoteFile)).then(function () {
resolve(that.mkdir(_path2.default.dirname(remoteFile), 'sftp', sftp).then(function () {
return putFile(false);

@@ -291,3 +306,3 @@ }));

var _ref8 = _asyncToGenerator(function* (files) {
var _this2 = this;
var _this3 = this;

@@ -317,3 +332,3 @@ var givenSftp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

yield Promise.all(chunk.map(function (file) {
return _this2.putFile(file.local, file.remote, sftp);
return _this3.putFile(file.local, file.remote, sftp);
}));

@@ -342,3 +357,3 @@ transferred = transferred.concat(chunk);

var _ref9 = _asyncToGenerator(function* (localDirectory, remoteDirectory) {
var _this3 = this;
var _this4 = this;

@@ -368,7 +383,7 @@ var givenConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

if (!directoriesCreated.has(remoteFileDirectory)) {
yield _this3.mkdir(remoteFileDirectory, 'sftp', sftp);
yield _this4.mkdir(remoteFileDirectory, 'sftp', sftp);
directoriesCreated.add(remoteFileDirectory);
}
try {
yield _this3.putFile(localFile, remoteFile, sftp);
yield _this4.putFile(localFile, remoteFile, sftp);
config.tick(localFile, remoteFile, null);

@@ -375,0 +390,0 @@ return true;

{
"name": "node-ssh",
"version": "4.0.0",
"version": "4.0.1",
"description": "SS2 with Promises",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc