Windows paths #28

Merged
domenic merged 2 commits from windows-paths into master 2012-05-16 08:32:48 -07:00
2 changed files with 8 additions and 8 deletions

View file

@ -49,7 +49,7 @@ exports.readdirSyncRecursive = function(baseDir) {
// convert absolute paths to relative // convert absolute paths to relative
var fileList = readdirSyncRecursive(baseDir).map(function(val){ var fileList = readdirSyncRecursive(baseDir).map(function(val){
return val.replace(baseDir + '/', ''); return _path.relative(baseDir, val);
}); });
return fileList; return fileList;
@ -106,7 +106,7 @@ exports.readdirRecursive = function(baseDir, fn) {
fn(null, curFiles.map(function(val) { fn(null, curFiles.map(function(val) {
// convert absolute paths to relative // convert absolute paths to relative
return val.replace(baseDir + '/', ''); return _path.relative(baseDir, val);
})); }));
if (waitCount == 0) { if (waitCount == 0) {

View file

@ -9,10 +9,10 @@ function checkResult(test, files) {
var check = [ var check = [
'bar.txt', 'bar.txt',
'foo', 'foo',
'foo/bar', path.join('foo', 'bar'),
'foo/dolor.md', path.join('foo', 'dolor.md'),
'foo/lorem.txt', path.join('foo', 'lorem.txt'),
'foo/bar/ipsum.js' path.join('foo', 'bar', 'ipsum.js')
]; ];
test.equals(files.length, check.length, 'number of paths is correct'); test.equals(files.length, check.length, 'number of paths is correct');
@ -26,7 +26,7 @@ function checkResult(test, files) {
module.exports = testCase({ module.exports = testCase({
test_readdirSyncRecursive: function(test) { test_readdirSyncRecursive: function(test) {
var dir = __dirname + '/readdir'; var dir = path.join(__dirname, 'readdir');
test.ok(path.existsSync(dir), 'Folders should exist'); test.ok(path.existsSync(dir), 'Folders should exist');
@ -36,7 +36,7 @@ module.exports = testCase({
}, },
test_readdirRecursive: function(test) { test_readdirRecursive: function(test) {
var dir = __dirname + '/readdir'; var dir = path.join(__dirname, 'readdir');
test.ok(path.existsSync(dir), 'Folders should exist'); test.ok(path.existsSync(dir), 'Folders should exist');