summaryrefslogtreecommitdiff
path: root/scripts/nitpick/submodule-pin.js
blob: 72d8f673c66f0c94cfc10bcc8790fcc6af64cc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env node
const nitpick = require('.');
const child_process = require('child_process');

// Make sure that the mapbox-gl-js submodule pin is up to date
const head = child_process.execSync('git -C mapbox-gl-js rev-parse HEAD').toString().trim();
const revs = child_process.execSync(`git -C mapbox-gl-js branch -a --contains ${head}`).toString().split('\n');

if (revs.indexOf('  remotes/origin/main') >= 0) {
    nitpick.ok(`mapbox-gl-js submodule pin is merged to main`);
} else {
    nitpick.fail(`mapbox-gl-js submodule is pinned to ${head}, which isn't merged to main`);
}