Skip to content

Commit 9bb7fc0

Browse files
committed
Fix pull script issues.
1 parent ead7534 commit 9bb7fc0

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

uc_python/pull.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import os
2-
import subprocess
2+
import shutil
3+
from subprocess import run, PIPE
4+
from pathlib import Path
35

46
from .repos import repos
57

8+
folder = Path("repos")
9+
folder.mkdir(exist_ok=True)
10+
subfolders = [f for f in folder.glob("*") if f.is_dir()]
11+
for s in subfolders:
12+
print(f"deleting {s}")
13+
shutil.rmtree(s)
14+
15+
os.chdir(folder)
616
for repo in repos:
7-
os.mkdir("repos")
8-
os.chdir("repos")
9-
subprocess.run(["git", "clone", repo.url], check=True)
10-
os.chdir("..")
17+
print(f"cloning {repo.name}...")
18+
run(["git", "clone", repo.url], check=True, stdout=PIPE, stderr=PIPE)
19+
print("done")

0 commit comments

Comments
 (0)