20 lines
510 B
Python
20 lines
510 B
Python
#!/usr/bin/env python3
|
|
from os import mkdir
|
|
from os.path import exists
|
|
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["clone_url"]] for p in response.json()]
|
|
clones = Path("clones").absolute()
|
|
if not exists(clones):
|
|
mkdir(clones)
|
|
for name, url in repos:
|
|
try:
|
|
run(split(f"git clone {url} {clones}/{name}"))
|
|
except Exception:
|
|
pass
|