Skip to content

Commit

Permalink
Normalize paths on Windows to Unix convention
Browse files Browse the repository at this point in the history
Convert “\” to “/“ in relative paths in fs.list
  • Loading branch information
Aaron O'Mullan committed Apr 6, 2014
1 parent 12b5baf commit b330277
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/generate/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b330277

Please sign in to comment.