Convert a path to a proper file:// URL for platformio.ini files.
(path: Path)
| 559 | |
| 560 | |
| 561 | def get_proper_file_url(path: Path) -> str: |
| 562 | """Convert a path to a proper file:// URL for platformio.ini files.""" |
| 563 | # For PlatformIO on Windows, use the Windows path directly (not file:// URL) |
| 564 | # This avoids issues with path parsing in PlatformIO |
| 565 | import platform |
| 566 | |
| 567 | resolved_path = path.resolve() |
| 568 | |
| 569 | if platform.system() == "Windows": |
| 570 | # On Windows, PlatformIO handles Windows paths directly better than file:// URLs |
| 571 | # Convert to Windows path format |
| 572 | return str(resolved_path) |
| 573 | else: |
| 574 | # On Unix systems, use proper file:// URL format |
| 575 | posix_path = resolved_path.as_posix() |
| 576 | return f"file://{posix_path}" |
| 577 | |
| 578 | |
| 579 | def unzip_and_install( |
no test coverage detected