MCPcopy Create free account
hub / github.com/anomalyco/opencode / renderRun

Function renderRun

packages/core/script/migration.ts:165–169  ·  view source on GitHub ↗
(statement: string)

Source from the content-addressed store, hash-verified

163}
164
165function renderRun(statement: string) {
166 const lines = statement.replaceAll("\t", " ").split("\n")
167 if (lines.length === 1) return ` yield* tx.run(\`${escapeTemplate(lines[0])}\`)`
168 return ` yield* tx.run(\`\n${lines.map((line) => ` ${escapeTemplate(line)}`).join("\n")}\n \`)`
169}
170
171function escapeTemplate(line: string) {
172 return line.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${")

Callers

nothing calls this directly

Calls 1

escapeTemplateFunction · 0.85

Tested by

no test coverage detected