Permalink
Browse files

pathes work on windows machines as well

  • Loading branch information...
1 parent 5f71818 commit 5279027686db80f61544cf17abb241edf681422b Stephan Ziep committed Jun 27, 2013
Showing with 12 additions and 5 deletions.
  1. +5 −1 tasks/lib/file-graph.js
  2. +4 −3 test/dep-concat_test.js
  3. +2 −1 test/fixtures/9.js
  4. +1 −0 test/fixtures/somedir/12.js
View
@@ -143,7 +143,7 @@ exports.init = function( grunt ) {
}
if ( fileList ) {
- var files = _.words( split[1], ',' ).map( trimElems );
+ var files = _.words( split[1], ',' ).map( trimElems ).map(normalizePath);
push.apply( fileList, files );
}
}
@@ -163,5 +163,9 @@ exports.init = function( grunt ) {
return _( str ).trim();
};
+ var normalizePath = function( p ) {
+ return p.replace(/[\/\\]+/g, path.sep);
+ };
+
return exports;
};
View
@@ -36,7 +36,7 @@ exports['dep-concat'] = {
helper: function( test ) {
var _ = grunt.util._;
- test.expect( 11 );
+ test.expect( 12 );
var depList = fileGraph.parseFile( 'test/fixtures/main.js', {
basePath: 'test/fixtures/'
});
@@ -56,7 +56,7 @@ exports['dep-concat'] = {
basePath: 'test/fixtures/'
}, function( orderedFiles ) {
var indices = {};
- _.each([ 'main', 2, 5, 7, 8, 9, 10, 11 ], function( file ) {
+ _.each([ 'main', 2, 5, 7, 8, 9, 10, 11, 'somedir/12'], function( file ) {
indices[ file ] = orderedFiles.indexOf( 'test/fixtures/' + file + '.js' );
});
@@ -68,10 +68,11 @@ exports['dep-concat'] = {
test.ok( indices[ '5' ] > indices[ '11' ] );
test.ok( indices[ '11' ] > indices[ '9' ] );
test.ok( indices[ '11' ] > indices[ '2' ] );
+ test.ok( indices[ '9' ] > indices[ 'somedir/12' ] );
test.equal( _.filter( indices, function( e ) {
return e !== -1;
- }).length, 8, 'all files included' );
+ }).length, 9, 'all files included' );
test.done();
});
View
@@ -1 +1,2 @@
-// Some file
+// file path windows style
+//load: somedir\\12.js
@@ -0,0 +1 @@
+// some file

0 comments on commit 5279027

Please sign in to comment.