diff options
-rwxr-xr-x | platform/ios/scripts/release-notes.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/ios/scripts/release-notes.js b/platform/ios/scripts/release-notes.js index d7a7d6dbbb..41caff7fa4 100755 --- a/platform/ios/scripts/release-notes.js +++ b/platform/ios/scripts/release-notes.js @@ -6,7 +6,8 @@ const ejs = require('ejs'); const _ = require('lodash'); const semver = require('semver'); -const changelog = fs.readFileSync('platform/ios/CHANGELOG.md', 'utf8'); +const changelogPath = 'platform/ios/CHANGELOG.md'; +const changelog = fs.readFileSync(changelogPath, 'utf8'); let outputMode = {}; switch(process.argv[2]) { @@ -61,6 +62,11 @@ const versionsInReleaseNotes = _.map(releaseNotes, 'version'); const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInReleaseNotes, ">=" + currentVersion); const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion }); +if (!currentReleaseNotes) { + console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "master" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]); + process.exit(1); +} + /* Fill and print the release notes template. */ |