Clone to abra apps dir
This commit is contained in:
parent
5b1f4828bd
commit
8fc3927d40
|
@ -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}"))
|
||||
|
|
Reference in New Issue