Clone to abra apps dir

This commit is contained in:
Luke Murphy 2020-11-02 18:38:44 +01:00
parent 5b1f4828bd
commit 8fc3927d40
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 7 additions and 4 deletions

View File

@ -1,17 +1,20 @@
#!/usr/bin/env python3
from os import mkdir
from os.path import exists
from os.path import exists, expanduser
from pathlib import Path
from shlex import split
from subprocess import run
from requests import get
response = get("https://git.autonomic.zone/api/v1/orgs/coop-cloud/repos")
repos = [[p["name"], p["ssh_url"]] for p in response.json()]
clones = Path("clones").absolute()
home = expanduser("~/")
clones = Path(f"{home}/.abra/apps").absolute()
if not exists(clones):
mkdir(clones)
response = get("https://git.autonomic.zone/api/v1/orgs/coop-cloud/repos")
repos = [[p["name"], p["ssh_url"]] for p in response.json()]
for name, url in repos:
try:
run(split(f"git clone {url} {clones}/{name}"))