mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Lazily query for git branch & remote (#33936)
This commit is contained in:
@@ -159,16 +159,21 @@ 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')
|
||||
);
|
||||
try {
|
||||
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')
|
||||
);
|
||||
} catch (error) {
|
||||
// If not inside a git repo, we're going to fail here and return.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isOnAReleaseTag() {
|
||||
|
||||
Reference in New Issue
Block a user