Fix non-master branch switching for repos
This commit is contained in:
parent
fc12634fbb
commit
a5274f123c
@ -19,10 +19,11 @@ def clone_apps():
|
|||||||
repos = [[p["name"], p["ssh_url"]] for p in response.json()]
|
repos = [[p["name"], p["ssh_url"]] for p in response.json()]
|
||||||
for name, url in repos:
|
for name, url in repos:
|
||||||
try:
|
try:
|
||||||
run(split(f"git clone {url} {clones}/{name}"))
|
if not exists(f"{clones}/{name}"):
|
||||||
chdir(f"{clones}/{name}")
|
run(split(f"git clone {url} {clones}/{name}"))
|
||||||
if not check_output("git branch --list | wc -l", shell=True):
|
chdir(f"{clones}/{name}")
|
||||||
run(split("git checkout main"))
|
if not int(check_output("git branch --list | wc -l", shell=True)):
|
||||||
|
run(split("git checkout main"))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user