From 659b693fcdadf8d3df0f8ac4f35d7cb97250a413 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 30 May 2022 14:57:14 +0100 Subject: [PATCH] Fix hermes-utils.js building from source when on the release branch --- scripts/hermes/hermes-utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/hermes/hermes-utils.js b/scripts/hermes/hermes-utils.js index 763eb862145..9311615b429 100644 --- a/scripts/hermes/hermes-utils.js +++ b/scripts/hermes/hermes-utils.js @@ -158,9 +158,15 @@ function copyPodSpec() { ); } +function isOnAReleaseBranch() { + let currentBranch = execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim(); + let currentRemote = execSync(`git config --get remote.origin.url`).toString().trim(); + return currentBranch.endsWith('-stable') && currentRemote.endsWith('facebook/react-native.git'); +} + function shouldBuildHermesFromSource() { const hermesTag = readHermesTag(); - return hermesTag === DEFAULT_HERMES_TAG; + return isOnAReleaseBranch() || hermesTag === DEFAULT_HERMES_TAG; } function shouldUsePrebuiltHermesC(os) {