aboutsummaryrefslogtreecommitdiff
path: root/mirror.py
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2021-08-04 11:50:24 -0500
committerBlaise Thompson <blaise@untzag.com>2021-08-04 11:50:24 -0500
commit262faee7c475eae7a2883695753166fb0d2977db (patch)
treee870e98b41632759e1c0471eed74856647ebbcbf /mirror.py
parent243a1783e06c2a13ceb51ed55b2089c8a5be33ba (diff)
troubleshoot
Diffstat (limited to 'mirror.py')
-rw-r--r--mirror.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/mirror.py b/mirror.py
index 14051e2..e0f8e09 100644
--- a/mirror.py
+++ b/mirror.py
@@ -9,15 +9,10 @@ with open("mirrors.toml", "r") as f:
repositories = toml.load(f)
for path in repositories.keys():
- local_path = pathlib.Path(path)
+ local_path = pathlib.Path("/git") / pathlib.Path(path)
local_path.mkdir(exist_ok=True, parents=True)
- primary_url = repositories[path]["primary"]
secondary_urls = repositories[path]["secondary"]
os.chdir(str(local_path))
- if not pathlib.Path("git-daemon-export-ok").is_file():
- subprocess.run(["git", "init", "--bare"])
- subprocess.run(["git", "remote", "add", "origin", primary_url])
- pathlib.Path("git-daemon-export-ok").touch()
subprocess.run(["git", "remote", "update"])
subprocess.run(["git", "fetch", "origin", "'*:*'"])
for url in secondary_urls: