diff options
author | Jason Wray <jason@mapbox.com> | 2018-08-07 20:01:05 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-08-07 20:01:05 -0400 |
commit | fd73dea05e645041cf27a28ba67ce37eb6d4c6bc (patch) | |
tree | 28438e5fedba2d4447bd71d66d3bda6abc3d5b45 /scripts | |
parent | dfa7e3747626c09d03c080394ba2dfb3169874cc (diff) | |
download | qtlocation-mapboxgl-fd73dea05e645041cf27a28ba67ce37eb6d4c6bc.tar.gz |
Handle >2 branches by switching to split[0]
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/environment.js | 2 |
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}`); |