summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-02-06 14:08:26 -0800
committerJason Wray <jason@mapbox.com>2019-02-06 14:10:27 -0800
commite1723d0281fa8f709217fdfff3984a3f2778313c (patch)
tree4c19dc3431da4aaa628f541315da08f463024512
parentee443be7b4b26163682056fd8f45c46cf8dd34b9 (diff)
downloadqtlocation-mapboxgl-e1723d0281fa8f709217fdfff3984a3f2778313c.tar.gz
[ios, build] Improve error message when tagged version does not exist in changelog
-rwxr-xr-xplatform/ios/scripts/release-notes.js8
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.
*/