Use path.relative instead of manual string replacement.
Fixes Windows inconsistency (#26).
This commit is contained in:
parent
a4e5005030
commit
01190602da
1 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Reference in a new issue