Skip to content

Commit

Permalink
update Gruntfile.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mohayonao committed Mar 22, 2014
1 parent 8c729de commit 6d92ac7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,18 @@ module.exports = function(grunt) {
}

function testSorter(a, b) {
var r, p;
var r, p, cond = 0;

p = { undefined: 1, lang: 2 };
r = /^src\/sc\/(?:(.+?)\/)?(.+)\.js$/;
a = r.exec(a);
b = r.exec(b);

return ((p[a[1] + ""] || 6) - (p[b[1] + ""] || 6)) || (a[2] < b[2] ? -1 : +1);
cond = cond || (p[a[1]] || Infinity) - (p[b[1]] || Infinity);
cond = cond || a[2].split("/").length - b[2].split("/").length;
cond = cond || (a[2] < b[2] ? -1 : +1);

return cond;
}

grunt.registerTask("test", function(filter, reporter, cover) {
Expand Down

0 comments on commit 6d92ac7

Please sign in to comment.