(platform: Platform, project_root: Path, dry_run: bool)
| 149 | |
| 150 | |
| 151 | def generate_platform(platform: Platform, project_root: Path, dry_run: bool) -> None: |
| 152 | template = load_template() |
| 153 | rendered = render_template(template, platform) |
| 154 | |
| 155 | instruction_file = project_root / platform.instruction_path |
| 156 | cli_dest = project_root / platform.cli_path |
| 157 | |
| 158 | # Instruction file |
| 159 | if platform.format == "mdc": |
| 160 | content = (platform.mdc_frontmatter or "") + "\n" + rendered |
| 161 | _write_file(instruction_file, content, dry_run) |
| 162 | |
| 163 | elif platform.format == "append": |
| 164 | _append_with_markers(instruction_file, rendered, dry_run) |
| 165 | |
| 166 | else: # markdown |
| 167 | _write_file(instruction_file, rendered, dry_run) |
| 168 | |
| 169 | # Copy CLI script |
| 170 | _copy_file(CLI_SOURCE, cli_dest, dry_run) |
| 171 | |
| 172 | # Write env hint |
| 173 | env_hint = ( |
| 174 | f" Set CODERLM_STATE_DIR={platform.state_dir} when running the CLI\n" |
| 175 | f" (or the CLI defaults to .claude/coderlm_state)" |
| 176 | ) |
| 177 | print(f" Note: {env_hint}") |
| 178 | |
| 179 | |
| 180 | def clean_platform(platform: Platform, project_root: Path, dry_run: bool) -> None: |
no test coverage detected