Files
MapLibreParticleLab/scripts/nitpick/submodule-pin.js
2021-01-21 22:29:09 +01:00

14 lines
602 B
JavaScript
Executable File

#!/usr/bin/env node
const nitpick = require('.');
const child_process = require('child_process');
// Make sure that the maplibre-gl-js submodule pin is up to date
const head = child_process.execSync('git -C maplibre-gl-js rev-parse HEAD').toString().trim();
const revs = child_process.execSync(`git -C maplibre-gl-js branch -a --contains ${head}`).toString().split('\n');
if (revs.indexOf(' remotes/origin/master') >= 0) {
nitpick.ok(`maplibre-gl-js submodule pin is merged to master`);
} else {
nitpick.fail(`maplibre-gl-js submodule is pinned to ${head}, which isn't merged to master`);
}