Comparing version 2.0.6 to 2.0.7
@@ -16,2 +16,3 @@ 'use strict'; | ||
var Path = require('path'); | ||
var Escape = require('shell-escape'); | ||
@@ -23,4 +24,2 @@ var access = (0, _jsToolkit.promisify)(FS.access); | ||
// TODO: Escape cwd | ||
var SSH = (function () { | ||
@@ -93,3 +92,3 @@ function SSH() { | ||
options.stream = validStreams.has(options.stream) ? options.stream : 'stdout'; | ||
return this.execCommand([filePath].concat(args).join(' '), options).then(function (_ref) { | ||
return this.execCommand([filePath].concat(Escape(args)).join(' '), options).then(function (_ref) { | ||
var stdout = _ref.stdout; | ||
@@ -131,3 +130,3 @@ var stderr = _ref.stderr; | ||
if (options.cwd) { | ||
command = 'cd ' + options.cwd + ' ; ' + command; | ||
command = 'cd ' + Escape([options.cwd]) + ' ; ' + command; | ||
} | ||
@@ -134,0 +133,0 @@ return new Promise(function (resolve, reject) { |
{ | ||
"name": "node-ssh", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "SS2 with Promises", | ||
@@ -25,4 +25,5 @@ "main": "Dist/SSH.js", | ||
"js-toolkit": "0.0.5", | ||
"shell-escape": "^0.2.0", | ||
"ssh2": "^0.4.11" | ||
} | ||
} |
@@ -9,2 +9,3 @@ // @Compiler-Transpile "true" | ||
const Path = require('path') | ||
const Escape = require('shell-escape') | ||
@@ -16,4 +17,2 @@ const access = promisify(FS.access) | ||
// TODO: Escape cwd | ||
export default class SSH { | ||
@@ -72,3 +71,3 @@ constructor() { | ||
options.stream = validStreams.has(options.stream) ? options.stream : 'stdout' | ||
return this.execCommand([filePath].concat(args).join(' '), options).then(({stdout, stderr, code, signal}) => { | ||
return this.execCommand([filePath].concat(Escape(args)).join(' '), options).then(({stdout, stderr, code, signal}) => { | ||
if (options.stream === 'both') { | ||
@@ -99,3 +98,3 @@ return {stderr, stdout, code, signal} | ||
if (options.cwd) { | ||
command = 'cd ' + options.cwd + ' ; ' + command | ||
command = 'cd ' + Escape([options.cwd]) + ' ; ' + command | ||
} | ||
@@ -158,3 +157,3 @@ return new Promise((resolve, reject) => { | ||
const Promises = [] | ||
files.forEach((file) => { | ||
files.forEach(file => { | ||
Promises.push(this.put(file.Local, file.Remote, SFTP)) | ||
@@ -161,0 +160,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18783
3
+ Addedshell-escape@^0.2.0
+ Addedshell-escape@0.2.0(transitive)