Pick the right compile entry point per platform. On Linux/macOS: `bash compile esp32s3 --examples --platformio`. On Windows: ` /compile.bat esp32s3 --examples --platformio` (absolute path — Windows subprocess.run does not auto-resolve `.bat` files fr
(example: str)
| 224 | |
| 225 | |
| 226 | def _run_compile_cmd(example: str) -> list[str]: |
| 227 | """Pick the right compile entry point per platform. |
| 228 | |
| 229 | On Linux/macOS: `bash compile esp32s3 --examples <example> --platformio`. |
| 230 | On Windows: `<PROJECT_ROOT>/compile.bat esp32s3 --examples <example> |
| 231 | --platformio` (absolute path — Windows subprocess.run does not |
| 232 | auto-resolve `.bat` files from the cwd argument). `bash` is not on |
| 233 | PATH in a non-WSL Windows Python launched by `uv run`, and there is |
| 234 | no `bash.exe` in the project; the project ships `compile.bat` for |
| 235 | this case. See #2935. |
| 236 | """ |
| 237 | import os |
| 238 | |
| 239 | args = ["esp32s3", "--examples", example, "--platformio"] |
| 240 | if os.name == "nt": |
| 241 | return [str(PROJECT_ROOT / "compile.bat"), *args] |
| 242 | return ["bash", "compile", *args] |
| 243 | |
| 244 | |
| 245 | def _run_bloat_cmd() -> list[str]: |