summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-08-07 20:01:05 -0400
committerJason Wray <jason@mapbox.com>2018-08-07 20:01:05 -0400
commitfd73dea05e645041cf27a28ba67ce37eb6d4c6bc (patch)
tree28438e5fedba2d4447bd71d66d3bda6abc3d5b45 /scripts
parentdfa7e3747626c09d03c080394ba2dfb3169874cc (diff)
downloadqtlocation-mapboxgl-fd73dea05e645041cf27a28ba67ce37eb6d4c6bc.tar.gz
Handle >2 branches by switching to split[0]
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/environment.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/environment.js b/scripts/environment.js
index bb0be77886..0468be3720 100755
--- a/scripts/environment.js
+++ b/scripts/environment.js
@@ -24,7 +24,7 @@ if (pr) {
} else {
const head = process.env['CIRCLE_SHA1'];
for (const sha of execSync(`git rev-list --max-count=10 ${head}`).toString().trim().split('\n')) {
- const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().replace(/$\n.*/m, '').trim().replace(/^origin\//, '');
+ const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().split('\n')[0].trim().replace(/^origin\//, '');
if (base) {
const mergeBase = execSync(`git merge-base origin/${base} ${head}`).toString().trim();
console.log(`export CIRCLE_TARGET_BRANCH=${base}`);