Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Use path.relative instead of manual string replacement.
Browse files Browse the repository at this point in the history
Fixes Windows inconsistency (#26).
  • Loading branch information
domenic committed May 14, 2012
1 parent a4e5005 commit 0119060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wrench.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.readdirSyncRecursive = function(baseDir) {

// convert absolute paths to relative
var fileList = readdirSyncRecursive(baseDir).map(function(val){
return val.replace(baseDir + '/', '');
return _path.relative(baseDir, val);
});

return fileList;
Expand Down Expand Up @@ -106,7 +106,7 @@ exports.readdirRecursive = function(baseDir, fn) {

fn(null, curFiles.map(function(val) {
// convert absolute paths to relative
return val.replace(baseDir + '/', '');
return _path.relative(baseDir, val);
}));

if (waitCount == 0) {
Expand Down

0 comments on commit 0119060

Please sign in to comment.