diff options
author | Jason Wray <jason@mapbox.com> | 2019-02-06 14:08:26 -0800 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2019-02-06 14:10:27 -0800 |
commit | e1723d0281fa8f709217fdfff3984a3f2778313c (patch) | |
tree | 4c19dc3431da4aaa628f541315da08f463024512 | |
parent | ee443be7b4b26163682056fd8f45c46cf8dd34b9 (diff) | |
download | qtlocation-mapboxgl-e1723d0281fa8f709217fdfff3984a3f2778313c.tar.gz |
[ios, build] Improve error message when tagged version does not exist in changelog
-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. */ |