From 07adead2ca7936462097ceed41bb4d8495af8324 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Tue, 27 Feb 2024 22:12:09 +0000 Subject: [PATCH] sanitycheck: avoid error after emitting changelog error --- bin/sanitycheck.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index 78cadc34c..3bb9a822a 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -150,10 +150,13 @@ apps.forEach((app,appIdx) => { } else { var changeLog = fs.readFileSync(appDir+"ChangeLog").toString(); var versions = changeLog.match(/\d+\.\d+:/g); - if (!versions) ERROR(`No versions found in ${app.id} ChangeLog (${appDir}ChangeLog)`, {file:metadataFile}); - var lastChangeLog = versions.pop().slice(0,-1); - if (lastChangeLog != app.version) - ERROR(`App ${app.id} app version (${app.version}) and ChangeLog (${lastChangeLog}) don't agree`, {file:appDirRelative+"ChangeLog", line:changeLog.split("\n").length-1}); + if (!versions) { + ERROR(`No versions found in ${app.id} ChangeLog (${appDir}ChangeLog)`, {file:metadataFile}); + } else { + var lastChangeLog = versions.pop().slice(0,-1); + if (lastChangeLog != app.version) + ERROR(`App ${app.id} app version (${app.version}) and ChangeLog (${lastChangeLog}) don't agree`, {file:appDirRelative+"ChangeLog", line:changeLog.split("\n").length-1}); + } } } if (!app.description) ERROR(`App ${app.id} has no description`, {file:metadataFile});