MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / destinationPathForSource

Function destinationPathForSource

packages/core/src/tools/scaffold.ts:177–184  ·  view source on GitHub ↗
(destPath: string, sourcePath: string)

Source from the content-addressed store, hash-verified

175}
176
177function destinationPathForSource(destPath: string, sourcePath: string): string {
178 const normalizedDestPath = destPath.replace(/\\/g, '/');
179 const sourceExt = path.extname(sourcePath);
180 if (sourceExt.length === 0) return normalizedDestPath;
181 const parsed = path.posix.parse(normalizedDestPath);
182 if (parsed.ext.toLowerCase() === sourceExt.toLowerCase()) return normalizedDestPath;
183 return path.posix.join(parsed.dir, `${parsed.name}${sourceExt}`);
184}
185
186export async function runScaffold(req: ScaffoldRequest): Promise<ScaffoldResult> {
187 let manifest: ScaffoldManifest;

Callers 1

runScaffoldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected