(platform: Platform, project_root: Path, dry_run: bool)
| 178 | |
| 179 | |
| 180 | def clean_platform(platform: Platform, project_root: Path, dry_run: bool) -> None: |
| 181 | instruction_file = project_root / platform.instruction_path |
| 182 | cli_dest = project_root / platform.cli_path |
| 183 | cli_dir = cli_dest.parent |
| 184 | state_dir = project_root / platform.state_dir |
| 185 | |
| 186 | if platform.format == "append": |
| 187 | _remove_markers(instruction_file, dry_run) |
| 188 | else: |
| 189 | _remove_file(instruction_file, dry_run) |
| 190 | |
| 191 | _remove_file(cli_dest, dry_run) |
| 192 | |
| 193 | # Remove state dir if empty |
| 194 | _remove_dir_if_empty(state_dir, dry_run) |
| 195 | # Remove CLI parent dir if empty |
| 196 | _remove_dir_if_empty(cli_dir, dry_run) |
| 197 | |
| 198 | |
| 199 | # -- File operations -- |
no test coverage detected