Skip to content

Commit

Permalink
Check isOnAReleaseTag alongside isOnAReleaseBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico committed May 30, 2022
1 parent 9a4e716 commit 0ca6e41
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion scripts/hermes/hermes-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,27 @@ function isOnAReleaseBranch() {
);
}

function isOnAReleaseTag() {
try {
// If on a named tag, this method will return the tag name.
// If not, it will throw as the return code is not 0.
execSync('git describe --exact-match HEAD', {stdio: 'ignore'});
} catch (error) {
return false;
}
let currentRemote = execSync('git config --get remote.origin.url')
.toString()
.trim();
return currentRemote.endsWith('facebook/react-native.git');
}

function shouldBuildHermesFromSource() {
const hermesTag = readHermesTag();
return isOnAReleaseBranch() || hermesTag === DEFAULT_HERMES_TAG;
return (
isOnAReleaseBranch() ||
isOnAReleaseTag() ||
hermesTag === DEFAULT_HERMES_TAG
);
}

function shouldUsePrebuiltHermesC(os) {
Expand Down

0 comments on commit 0ca6e41

Please sign in to comment.