From 9cb2131bb63e32428dd8018882a8ef84d502e371 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Wed, 26 Mar 2014 20:33:56 -0700 Subject: [PATCH] Check package notices line length --- scripts/admin/bless-release.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/scripts/admin/bless-release.js b/scripts/admin/bless-release.js index 9a9b2d3247..ade802b47c 100644 --- a/scripts/admin/bless-release.js +++ b/scripts/admin/bless-release.js @@ -248,11 +248,28 @@ var main = function () { _.each(notices, function (record) { if (!record.release) die("An element of notices.json lacks a release."); - _.each(record.notices, function (line) { - if (line.length + record.release.length + 2 > 80) { - die("notices.json: notice line too long: " + line); + + var checkNotices = function (lines) { + if (!(lines instanceof Array)) { + die("notices.json: notice not array"); } - }); + + _.each(lines, function (line) { + if (line.length + record.release.length + 2 > 80) { + die("notices.json: notice line too long: " + line); + } + }); + }; + + if (record.notices) { + checkNotices(record.notices); + } + + if (record.packageNotices) { + _.each(record.packageNotices, function (lines, pkg) { + checkNotices(lines); + }); + } }); var bannerFilename = path.resolve(__dirname, 'banner.txt');