From 42fde9b5e2f9d08c8a134a09c240fb1b531bc771 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 6 Sep 2018 21:38:17 +0100 Subject: [PATCH] chore: another attempt to fix pptr@next (#3210) It turns out that travis runs commands in sh rather then in bash. Fixes #2925. --- utils/apply_next_version.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utils/apply_next_version.js b/utils/apply_next_version.js index 7deaf77a637..7ee7cb6e582 100644 --- a/utils/apply_next_version.js +++ b/utils/apply_next_version.js @@ -1,15 +1,13 @@ const path = require('path'); const fs = require('fs'); -const child_process = require('child_process'); +const execSync = require('child_process').execSync; // Compare current HEAD to upstream master SHA. // If they are not equal - refuse to publish since // we're not tip-of-tree. -const upstream_sha = `git ls-remote https://github.com/GoogleChrome/puppeteer --tags master | cut -f1`; -const current_sha = `git rev-parse HEAD`; -const command = `if [[ $(${upstream_sha}) == $(${current_sha}) ]]; then echo "yes"; else echo "no"; fi`; -const output = child_process.execSync(command).toString('utf8'); -if (output.trim() !== 'yes') { +const upstream_sha = execSync(`git ls-remote https://github.com/GoogleChrome/puppeteer --tags master | cut -f1`).toString('utf8'); +const current_sha = execSync(`git rev-parse HEAD`).toString('utf8'); +if (upstream_sha.trim() !== current_sha.trim()) { console.log('REFUSING TO PUBLISH: this is not tip-of-tree!'); process.exit(1); return;