Skip to content

Commit

Permalink
revert windows path unescaping, fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Aug 30, 2019
1 parent c24f3aa commit 144e1c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ exports.quote = function (xs) {
return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
}
else {
s = String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2');

// unescape paths in windows
s = s.replace(/\\\\/g, '\\')
return s
return String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2');
}
}).join(' ');
};
Expand Down
2 changes: 1 addition & 1 deletion test/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('quote ops', function (t) {
t.end();
});

test('quote windows paths', function (t) {
test('quote windows paths', { skip: 'breaking change, disabled until 2.x' }, 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\'')
Expand Down

0 comments on commit 144e1c2

Please sign in to comment.