Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
changed registered helper to simple function callback
  • Loading branch information
ronchalant committed Oct 15, 2012
commit 3076031b0b039e75175030a7139baae74900d633
9 changes: 5 additions & 4 deletions tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ grunt.registerHelper( "wordpress-parse-post-flex", function( path ) {
return grunt.helper( "wordpress-parse-post", path );
});

// Retrieves unique (?) author history for file from git
grunt.registerHelper( "retrieve-git-authors", function( path, doneFunction ) {
// Retrieves unique author history for file from git
function retrieveGitAuthors( path, doneFunction ) {
var _ = grunt.utils._,
parseRE = /^(.*)<(.*)>$/; // could certainly be better.

Expand All @@ -61,6 +61,7 @@ grunt.registerHelper( "retrieve-git-authors", function( path, doneFunction ) {
doneFunction(authors);
return;
}

// make unique.
result.stdout.split(/\r?\n/g).forEach(function(line) {
if (_.contains(authors, line)) {
Expand All @@ -82,7 +83,7 @@ grunt.registerHelper( "retrieve-git-authors", function( path, doneFunction ) {

doneFunction(authors);
});
});
}

// Process a YAML order file and return an object of page slugs and their ordinal indices
grunt.registerHelper( "read-order", function( orderFile ) {
Expand Down Expand Up @@ -157,7 +158,7 @@ grunt.registerMultiTask( "build-pages", "Process html and markdown files as page
delete post.content;


grunt.helper( "retrieve-git-authors", fileName, function( authors ) {
retrieveGitAuthors( fileName, function( authors ) {
post.authors = authors;

// Convert markdown to HTML
Expand Down