Remove stale linked artifacts after a hard link failure.
(sketch_cache_dir: Path, output_js: Path)
| 1575 | |
| 1576 | |
| 1577 | def _clear_linked_output(sketch_cache_dir: Path, output_js: Path) -> None: |
| 1578 | """Remove stale linked artifacts after a hard link failure.""" |
| 1579 | output_dir = output_js.parent |
| 1580 | stale_paths = [ |
| 1581 | sketch_cache_dir / "fastled.js", |
| 1582 | sketch_cache_dir / "fastled.wasm", |
| 1583 | sketch_cache_dir / "fastled.wasm.dwarf", |
| 1584 | output_js, |
| 1585 | output_js.with_suffix(".wasm"), |
| 1586 | output_dir / "fastled.wasm.dwarf", |
| 1587 | ] |
| 1588 | for path in stale_paths: |
| 1589 | path.unlink(missing_ok=True) |
| 1590 | |
| 1591 | |
| 1592 | def _copy_from_dist(dist_dir: Path, output_dir: Path) -> None: |