Skip to content

Commit 0ca6e41

Browse files
committed
Check isOnAReleaseTag alongside isOnAReleaseBranch
1 parent 9a4e716 commit 0ca6e41

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

scripts/hermes/hermes-utils.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,27 @@ function isOnAReleaseBranch() {
171171
);
172172
}
173173

174+
function isOnAReleaseTag() {
175+
try {
176+
// If on a named tag, this method will return the tag name.
177+
// If not, it will throw as the return code is not 0.
178+
execSync('git describe --exact-match HEAD', {stdio: 'ignore'});
179+
} catch (error) {
180+
return false;
181+
}
182+
let currentRemote = execSync('git config --get remote.origin.url')
183+
.toString()
184+
.trim();
185+
return currentRemote.endsWith('facebook/react-native.git');
186+
}
187+
174188
function shouldBuildHermesFromSource() {
175189
const hermesTag = readHermesTag();
176-
return isOnAReleaseBranch() || hermesTag === DEFAULT_HERMES_TAG;
190+
return (
191+
isOnAReleaseBranch() ||
192+
isOnAReleaseTag() ||
193+
hermesTag === DEFAULT_HERMES_TAG
194+
);
177195
}
178196

179197
function shouldUsePrebuiltHermesC(os) {

0 commit comments

Comments
 (0)