-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclone_modules.py
More file actions
33 lines (28 loc) · 1.2 KB
/
clone_modules.py
File metadata and controls
33 lines (28 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
import os
import subprocess
MOD_DIR = "modules"
os.makedirs(MOD_DIR, exist_ok=True)
# --- OKCompressor-only repo URLs ---
repos = {
"dumb_pre": "git@github.com:OKCompressor/dumb_pre.git",
"redumb": "git@github.com:OKCompressor/redumb.git",
"ngram-pos": "git@github.com:OKCompressor/ngram-pos.git",
"cc_nlp": "git@github.com:OKCompressor/cc_nlp.git",
"ngram-dawg": "git@github.com:OKCompressor/ngram-dawg.git",
"crux2": "git@github.com:OKCompressor/crux2.git",
"core": "git@github.com:OKCompressor/core.git"
}
print(f"[Luna] Checking/Cloning {len(repos)} OKCompressor modules to ./{MOD_DIR}/\n")
for name, url in repos.items():
mod_path = os.path.join(MOD_DIR, name)
if os.path.isdir(mod_path):
print(f" [✔] {name}: already exists, skipping.")
else:
print(f" [→] {name}: cloning from {url} ...")
try:
subprocess.run(["git", "clone", url, mod_path], check=True)
print(f" [✓] {name}: clone complete.")
except subprocess.CalledProcessError as e:
print(f" [✗] ERROR cloning {name}: {e}")
print("\n[Luna] Module repo sync complete. All available modules are ready.")