mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Remove path.relative() which produce unexpected results on Windows
This commit is contained in:
parent
f784a395ce
commit
ab6dbfb49e
1 changed files with 3 additions and 5 deletions
|
@ -1,4 +1,3 @@
|
|||
var path = require('path');
|
||||
var _ = require('lodash');
|
||||
|
||||
function pathToArray(parts) {
|
||||
|
@ -34,11 +33,10 @@ module.exports = function(grunt) {
|
|||
grunt.log.warn('Source file "' + filepath + '" not found.');
|
||||
return false;
|
||||
} else {
|
||||
filepath = path.relative(options.base, filepath);
|
||||
return options.excludes.every(function(dir) {
|
||||
var keep = filepath.indexOf(dir + '/') < 0;
|
||||
var keep = filepath.indexOf(options.base + '/' + dir + '/') < 0;
|
||||
if (!keep) {
|
||||
grunt.verbose.writeln('Skipping %s%s...', (dir + '/').inverse.red, filepath.substr(dir.length + 1));
|
||||
grunt.verbose.writeln('Skipping %s/%s/%s...', options.base, dir.inverse.red, filepath.substr(options.base.length + dir.length + 2));
|
||||
}
|
||||
return keep;
|
||||
});
|
||||
|
@ -54,7 +52,7 @@ module.exports = function(grunt) {
|
|||
}
|
||||
|
||||
files.map(function(filepath) {
|
||||
return pathToArray(path.relative(options.base, filepath).split('/'));
|
||||
return pathToArray(filepath.substr(options.base.length + 1).split('/'));
|
||||
}).forEach(function(parts) {
|
||||
_.merge(results, parts, function(a, b) {
|
||||
var example = {
|
||||
|
|
Loading…
Reference in a new issue