updated sidebar
This commit is contained in:
22
build.py
22
build.py
@@ -179,10 +179,20 @@ def build_managed(output_dir: Path, cfg_name: str, config: dict):
|
||||
):
|
||||
copy_path(item, managed_dir / item.name)
|
||||
|
||||
# Scripts from ctrl/ -> managed/ctrl/
|
||||
# Copy managed app config from cfg/<room>/<managed_name>/ (e.g., .env, dumps/)
|
||||
room_managed_cfg = room_cfg / managed_name
|
||||
if room_managed_cfg.exists():
|
||||
log.info(f" Copying {managed_name} config...")
|
||||
for item in room_managed_cfg.iterdir():
|
||||
if item.is_file():
|
||||
copy_path(item, managed_dir / item.name, quiet=True)
|
||||
elif item.is_dir():
|
||||
copy_path(item, managed_dir / item.name)
|
||||
|
||||
# Scripts from ctrl/ -> output_dir/ctrl/ (sibling of managed, link, soleprint)
|
||||
room_ctrl = room_cfg / "ctrl"
|
||||
if room_ctrl.exists():
|
||||
ctrl_dir = managed_dir / "ctrl"
|
||||
ctrl_dir = output_dir / "ctrl"
|
||||
ensure_dir(ctrl_dir)
|
||||
for item in room_ctrl.iterdir():
|
||||
if item.is_file():
|
||||
@@ -307,13 +317,19 @@ def build_soleprint(output_dir: Path, room: str):
|
||||
log.warning("Model generation failed")
|
||||
|
||||
|
||||
def build(output_dir: Path, cfg_name: str | None = None):
|
||||
def build(output_dir: Path, cfg_name: str | None = None, clean: bool = True):
|
||||
"""Build complete room instance."""
|
||||
room = cfg_name or "standalone"
|
||||
config = load_config(cfg_name)
|
||||
managed = config.get("managed")
|
||||
|
||||
log.info(f"\n=== Building {room} ===")
|
||||
|
||||
# Clean output directory first
|
||||
if clean and output_dir.exists():
|
||||
log.info(f"Cleaning {output_dir}...")
|
||||
shutil.rmtree(output_dir)
|
||||
|
||||
ensure_dir(output_dir)
|
||||
|
||||
if managed:
|
||||
|
||||
Reference in New Issue
Block a user