MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / commonOutputDirectory

Function commonOutputDirectory

packages/cli/src/commands/batchRender.ts:157–171  ·  view source on GitHub ↗
(outputPaths: readonly string[])

Source from the content-addressed store, hash-verified

155}
156
157export function commonOutputDirectory(outputPaths: readonly string[]): string {
158 const firstPath = outputPaths[0];
159 if (!firstPath) return resolve("renders");
160
161 let common = dirname(firstPath);
162 for (const outputPath of outputPaths.slice(1)) {
163 const dir = dirname(outputPath);
164 while (!isSameOrChildPath(dir, common)) {
165 const parent = dirname(common);
166 if (parent === common) return common;
167 common = parent;
168 }
169 }
170 return common;
171}
172
173function checkOutputCollisions(rows: readonly PreparedBatchRow[], manifestPath: string): void {
174 const seen = new Map<string, number>();

Callers 1

prepareBatchRenderFunction · 0.85

Calls 2

resolveFunction · 0.85
isSameOrChildPathFunction · 0.85

Tested by

no test coverage detected