Skip to content

Commit

Permalink
util: unixifyPath now strips windows drive letters for a true unix-st…
Browse files Browse the repository at this point in the history
…yle path.
  • Loading branch information
ctalkington committed Nov 29, 2015
1 parent 79a6a76 commit ad521da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ util.trailingSlashIt = function(str) {

util.unixifyPath = function() {
var filepath = path.join.apply(path, arguments);
return filepath.replace(/\\/g, '/');
return filepath.replace(/\\/g, '/').replace(/^\w+:/, '');
};

util.walkdir = function(dirpath, base, callback) {
Expand Down
1 change: 1 addition & 0 deletions test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('utils', function() {
describe('unixifyPath(filepath)', function() {
it('should unixify filepath', function() {
assert.equal(utils.unixifyPath('this\\path\\file.txt'), 'this/path/file.txt');
assert.equal(utils.unixifyPath('c:\\this\\path\\file.txt'), '/this/path/file.txt');
});
});

Expand Down

0 comments on commit ad521da

Please sign in to comment.