summaryrefslogtreecommitdiff
path: root/scripts/nitpick/submodule-pin.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nitpick/submodule-pin.js')
-rwxr-xr-xscripts/nitpick/submodule-pin.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/nitpick/submodule-pin.js b/scripts/nitpick/submodule-pin.js
new file mode 100755
index 0000000000..7ca129e096
--- /dev/null
+++ b/scripts/nitpick/submodule-pin.js
@@ -0,0 +1,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/master') >= 0) {
+ nitpick.ok(`mapbox-gl-js submodule pin is merged to master`);
+} else {
+ nitpick.fail(`mapbox-gl-js submodule is pinned to ${head}, which isn't merged to master`);
+}