Support HTTPS/SSH cloning

This commit is contained in:
decentral1se 2021-06-05 07:58:24 +02:00
parent 7b0fb50e7f
commit 76d5a1026a
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A
2 changed files with 6 additions and 3 deletions

View File

@ -78,12 +78,15 @@ def get_repos_json():
exit(1)
def clone_all_apps(repos_json):
def clone_all_apps(repos_json, ssh=False):
"""Clone all Co-op Cloud apps to ~/.abra/apps."""
if not exists(CLONES_PATH):
mkdir(CLONES_PATH)
repos = [[p["name"], p["ssh_url"]] for p in repos_json]
if ssh:
repos = [[p["name"], p["ssh_url"]] for p in repos_json]
else:
repos = [[p["name"], p["clone_url"]] for p in repos_json]
for name, url in repos:
if name in REPOS_TO_SKIP:

View File

@ -10,7 +10,7 @@ from abralib import clone_all_apps, get_repos_json
def main():
"""Run the script."""
repos_json = get_repos_json()
clone_all_apps(repos_json)
clone_all_apps(repos_json, ssh=True)
main()