Normalize paths on Windows to Unix convention

Convert “\” to “/“ in relative paths in fs.list
This commit is contained in:
Aaron O'Mullan
2014-04-05 18:44:50 -07:00
parent 12b5baf433
commit b330277ed7
+10 -2
View File
@@ -27,13 +27,21 @@ var getFiles = function(path) {
});
ig.on('end', function() {
d.resolve(files);
// Normalize paths on Windows
if(process.platform === 'win32') {
return d.resolve(files.map(function(file) {
return file.replace(/\\/g, '/');
}));
}
// Simply return paths otherwise
return d.resolve(files);
});
ig.on('error', d.reject);
return d.promise;
}
};
module.exports = {
list: getFiles,