Fix non-master branch switching for repos

This commit is contained in:
decentral1se 2021-03-26 20:21:37 +01:00
parent fc12634fbb
commit a5274f123c
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -19,9 +19,10 @@ 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:
if not exists(f"{clones}/{name}"):
run(split(f"git clone {url} {clones}/{name}")) run(split(f"git clone {url} {clones}/{name}"))
chdir(f"{clones}/{name}") chdir(f"{clones}/{name}")
if not check_output("git branch --list | wc -l", shell=True): if not int(check_output("git branch --list | wc -l", shell=True)):
run(split("git checkout main")) run(split("git checkout main"))
except Exception: except Exception:
pass pass