mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 03:16:40 +00:00
Normalize paths on Windows to Unix convention
Convert “\” to “/“ in relative paths in fs.list
This commit is contained in:
+10
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user