Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pathes work on windows machines as well

  • Loading branch information...
commit 70ff7a74a850d5a90086571877c1bb7ead4c249f 1 parent 5f71818
Stephan Ziep authored
View
6 tasks/lib/file-graph.js
@@ -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
7 test/dep-concat_test.js
@@ -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
3  test/fixtures/9.js
@@ -1 +1,2 @@
-// Some file
+// file path windows style
+//load: somedir\12.js
View
1  test/fixtures/somedir/12.js
@@ -0,0 +1 @@
+// some file
Please sign in to comment.
Something went wrong with that request. Please try again.