MCPcopy Create free account
hub / github.com/JaredStewart/coderlm / generate_platform

Function generate_platform

plugin/generate.py:151–177  ·  view source on GitHub ↗
(platform: Platform, project_root: Path, dry_run: bool)

Source from the content-addressed store, hash-verified

149
150
151def 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
180def clean_platform(platform: Platform, project_root: Path, dry_run: bool) -> None:

Callers 1

mainFunction · 0.85

Calls 5

load_templateFunction · 0.85
render_templateFunction · 0.85
_write_fileFunction · 0.85
_append_with_markersFunction · 0.85
_copy_fileFunction · 0.85

Tested by

no test coverage detected