Permalink
Browse files

Use `path.relative` instead of manual string replacement.

Fixes Windows inconsistency (#26).
  • Loading branch information...
domenic committed May 14, 2012
1 parent a4e5005 commit 01190602dac64924fca2dae11912ffb560e636a0
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/wrench.js
@@ -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;
@@ -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) {

0 comments on commit 0119060

Please sign in to comment.