chore: change the way we look for upstream remote (#7230)

* chore: change the way we look for upstream remote

* chore: use js instead of shell

thanks christopher

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>

* chore: store the found upstream name

---------

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
This commit is contained in:
Maribeth Bottorff
2023-08-04 16:41:24 -07:00
committed by GitHub
parent 2ac13b5a28
commit 2a2b3b3ac5

View File

@@ -36,9 +36,8 @@ let upstream = null;
function getUpstream() {
if (upstream) return upstream;
for (const line of String(execSync('git remote -v')).split('\n')) {
const [remote, url] = line.split('\t');
if (url.includes('github.com/google/blockly')) {
upstream = remote;
if (line.includes('google/blockly')) {
upstream = line.split('\t')[0];
return upstream;
}
}