Skip to content

Commit

Permalink
Simplify release notes generator script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmethvin committed Jan 15, 2013
1 parent 348e1a7 commit e7a2e3c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 44 deletions.
39 changes: 22 additions & 17 deletions build/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@

var fs = require("fs"),
http = require("http"),
tmpl = require("mustache"),
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g,
categories = [],
version = process.argv[2];

var opts = {
version: "1.9 Beta 1",
short_version: "1.9b1",
final_version: "1.9",
categories: []
};
if ( !/^\d+\.\d+/.test( version ) ) {
console.error( "Invalid version number: " + version );
process.exit( 1 );
}

http.request({
host: "bugs.jquery.com",
port: 80,
method: "GET",
path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + opts.final_version
path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + version
}, function (res) {
var data = [];

Expand All @@ -36,19 +35,25 @@ http.request({
if ( "#" + match[1] !== match[2] ) {
var cat = match[3];

if ( !cur || cur.name !== cat ) {
cur = { name: match[3], niceName: match[3].replace(/^./, function(a){ return a.toUpperCase(); }), bugs: [] };
opts.categories.push( cur );
if ( !cur || cur !== cat ) {
if ( cur ) {
console.log("</ul>");
}
cur = cat;
console.log( "<h2>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h2>" );
console.log("<ul>");
}

cur.bugs.push({ ticket: match[1], title: match[2] });
console.log(
" <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" +
match[1] + ": " + match[2] + "</a></li>"
);
}
}
if ( cur ) {
console.log("</ul>");
}

buildNotes();
});
}).end();

function buildNotes() {
console.log( tmpl.to_html( fs.readFileSync("release-notes.txt", "utf8"), opts ) );
}
27 changes: 0 additions & 27 deletions build/release-notes.txt

This file was deleted.

0 comments on commit e7a2e3c

Please sign in to comment.