""" Workstation (Vagrant) build helpers for the Prole installer (root-level). Select an environment-specific Vagrantfile when present and compose the `vagrant up` command. UI remains elsewhere. """ from __future__ import annotations from pathlib import Path def select_vagrantfile(project_root: Path, env: str | None) -> Path: env_key = (env or "Dev").strip().lower() mapping = {"dev": "Vagrantfile.dev", "service": "Vagrantfile.service", "prod": "Vagrantfile.prod"} ws = Path(project_root) / "workstation" candidate = mapping.get(env_key) if candidate and (ws / candidate).exists(): return ws / candidate return ws / "Vagrantfile" def get_vagrant_up_command(project_root: Path, env: str | None) -> str: vf = select_vagrantfile(project_root, env) ws = Path(project_root) / "workstation" env_label = (env or "Dev").strip().title() return f"cd \"{ws}\" && VAGRANT_VAGRANTFILE=\"{vf}\" vagrant up # {env_label}"