mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
bonsai_deps: print executed commands
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
Must be run from the repository root.
|
Must be run from the repository root.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -12,12 +13,18 @@ DEPS = [
|
|||||||
("https://github.com/nortikin/sverchok.git", "sverchok"),
|
("https://github.com/nortikin/sverchok.git", "sverchok"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def run(command: list[str]) -> None:
|
||||||
|
print("$", shlex.join(command))
|
||||||
|
subprocess.check_call(command)
|
||||||
|
|
||||||
|
|
||||||
base = Path("src/bonsai/external_dependencies")
|
base = Path("src/bonsai/external_dependencies")
|
||||||
base.mkdir(parents=True, exist_ok=True)
|
base.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
for url, name in DEPS:
|
for url, name in DEPS:
|
||||||
path = base / name
|
path = base / name
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
subprocess.check_call(["git", "clone", url, str(path)])
|
run(["git", "clone", url, str(path)])
|
||||||
else:
|
else:
|
||||||
subprocess.check_call(["git", "-C", str(path), "pull", "--rebase"])
|
run(["git", "-C", str(path), "pull", "--rebase"])
|
||||||
|
|||||||
Reference in New Issue
Block a user