[ios, build] Fix bad changelog header and improve handling

Also, specifically require `execSync`.
This commit is contained in:
Jason Wray
2018-08-21 11:53:08 -04:00
parent be83bb76b8
commit d31df6a615
2 changed files with 7 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Added a new option to `MGLSymbolPlacement`, `MGLSymbolPlacementLineCenter`, that places the label relative to the center of the geometry. ([#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337))
* Added a `MGLShapeSourceOptionLineDistanceMetrics` property that enables or disables calculating line distance metrics.
## User location
### User location
* Added an `MGLMapView.locationManager` property and `MGLLocationManager` protocol for tracking user location using a custom alternative to `CLLocationManager`. ([#12013](https://github.com/mapbox/mapbox-gl-native/pull/12013))
* Fixed a crash that occurred when `MMELocationManager` was deallocated and the delegate was reporting updates. ([#12542](https://github.com/mapbox/mapbox-gl-native/pull/12542))

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env node
const fs = require('fs');
const child_process = require('child_process');
const execSync = require('child_process').execSync;
const ejs = require('ejs');
const _ = require('lodash');
const semver = require('semver');
@@ -11,12 +11,12 @@ const changelog = fs.readFileSync('platform/ios/CHANGELOG.md', 'utf8');
/*
Find current and immediately previous releases by parsing git tags.
*/
let currentVersion = child_process.execSync('git describe --tags --match=ios-v*.*.* --abbrev=0')
let currentVersion = execSync('git describe --tags --match=ios-v*.*.* --abbrev=0')
.toString()
.trim()
.replace('ios-v', '');
let gitTags = child_process.execSync('git tag --list ios-v*.*.*')
let gitTags = execSync('git tag --list ios-v*.*.*')
.toString()
.split('\n')
.map(function (tag) {
@@ -29,13 +29,13 @@ let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion);
Parse the raw changelog text and split it into individual releases.
This regular expression:
- Matches lines starting with "## ".
- Matches lines starting with "## x.x.x".
- Groups the version number.
- Skips the (optional) release date.
- Groups the changelog content.
- Ends when another "## " is found.
- Ends when another "## x.x.x" is found.
*/
const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## )/gms;
const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
let releaseNotes = [];
while (match = regex.exec(changelog)) {