mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: another attempt to fix pptr@next (#3210)
It turns out that travis runs commands in sh rather then in bash. Fixes #2925.
This commit is contained in:
parent
b7e922b5f5
commit
42fde9b5e2
@ -1,15 +1,13 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const child_process = require('child_process');
|
const execSync = require('child_process').execSync;
|
||||||
|
|
||||||
// Compare current HEAD to upstream master SHA.
|
// Compare current HEAD to upstream master SHA.
|
||||||
// If they are not equal - refuse to publish since
|
// If they are not equal - refuse to publish since
|
||||||
// we're not tip-of-tree.
|
// we're not tip-of-tree.
|
||||||
const upstream_sha = `git ls-remote https://github.com/GoogleChrome/puppeteer --tags master | cut -f1`;
|
const upstream_sha = execSync(`git ls-remote https://github.com/GoogleChrome/puppeteer --tags master | cut -f1`).toString('utf8');
|
||||||
const current_sha = `git rev-parse HEAD`;
|
const current_sha = execSync(`git rev-parse HEAD`).toString('utf8');
|
||||||
const command = `if [[ $(${upstream_sha}) == $(${current_sha}) ]]; then echo "yes"; else echo "no"; fi`;
|
if (upstream_sha.trim() !== current_sha.trim()) {
|
||||||
const output = child_process.execSync(command).toString('utf8');
|
|
||||||
if (output.trim() !== 'yes') {
|
|
||||||
console.log('REFUSING TO PUBLISH: this is not tip-of-tree!');
|
console.log('REFUSING TO PUBLISH: this is not tip-of-tree!');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user