shell-quote
Advanced tools
Comparing version
@@ -7,3 +7,6 @@ # acorn-node change log | ||
## 1.6.3 | ||
* Fix Windows path quoting problems. ([@dy](https://github.com/dy) in [#34](https://github.com/substack/node-shell-quote/pull/34)) | ||
## 1.6.2 | ||
* Remove dependencies in favour of native methods. ([@zertosh](https://github.com/zertosh) in [#21](https://github.com/substack/node-shell-quote/pull/21)) |
@@ -13,3 +13,7 @@ exports.quote = function (xs) { | ||
else { | ||
return String(s).replace(/([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '\\$1'); | ||
s = String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2'); | ||
// unescape paths in windows | ||
s = s.replace(/\\\\/g, '\\') | ||
return s | ||
} | ||
@@ -16,0 +20,0 @@ }).join(' '); |
{ | ||
"name": "shell-quote", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "quote and parse shell commands", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"tape": "~2.3.0" | ||
"tape": "4" | ||
}, | ||
@@ -9,0 +9,0 @@ "scripts": { |
@@ -34,1 +34,9 @@ var test = require('tape'); | ||
}); | ||
test('quote windows paths', function (t) { | ||
var path = 'C:\\projects\\node-shell-quote\\index.js' | ||
t.equal(quote([path, 'b', 'c d']), 'C:\\projects\\node-shell-quote\\index.js b \'c d\'') | ||
t.end() | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19834
2.03%399
2.05%0
-100%139
-2.8%