Merge 5d1d96379b into a4e5005030
This commit is contained in:
commit
523f54ddc2
2 changed files with 8 additions and 8 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) {
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ function checkResult(test, files) {
|
|||
var check = [
|
||||
'bar.txt',
|
||||
'foo',
|
||||
'foo/bar',
|
||||
'foo/dolor.md',
|
||||
'foo/lorem.txt',
|
||||
'foo/bar/ipsum.js'
|
||||
path.join('foo', 'bar'),
|
||||
path.join('foo', 'dolor.md'),
|
||||
path.join('foo', 'lorem.txt'),
|
||||
path.join('foo', 'bar', 'ipsum.js')
|
||||
];
|
||||
|
||||
test.equals(files.length, check.length, 'number of paths is correct');
|
||||
|
|
@ -26,7 +26,7 @@ function checkResult(test, files) {
|
|||
|
||||
module.exports = testCase({
|
||||
test_readdirSyncRecursive: function(test) {
|
||||
var dir = __dirname + '/readdir';
|
||||
var dir = path.join(__dirname, 'readdir');
|
||||
|
||||
test.ok(path.existsSync(dir), 'Folders should exist');
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ module.exports = testCase({
|
|||
},
|
||||
|
||||
test_readdirRecursive: function(test) {
|
||||
var dir = __dirname + '/readdir';
|
||||
var dir = path.join(__dirname, 'readdir');
|
||||
|
||||
test.ok(path.existsSync(dir), 'Folders should exist');
|
||||
|
||||
|
|
|
|||
Reference in a new issue