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

Function fetchRemoteTemplate

packages/cli/src/templates/remote.ts:52–68  ·  view source on GitHub ↗
(templateId: string, destDir: string)

Source from the content-addressed store, hash-verified

50 * aborts before a single file is written.
51 */
52export async function fetchRemoteTemplate(templateId: string, destDir: string): Promise<void> {
53 const items = await resolveItemWithDependencies(templateId);
54 const warnings = gateRegistryItemsCompatibility(items);
55 for (const warning of warnings) {
56 process.stderr.write(`hyperframes:registry ${warning}\n`);
57 }
58 for (const item of items) {
59 await installItem(item, { destDir });
60 }
61
62 // Safety check — an item with no index.html isn't a valid example.
63 if (!existsSync(join(destDir, "index.html"))) {
64 throw new Error(
65 `Example "${templateId}" installed but missing index.html. The registry item may be malformed.`,
66 );
67 }
68}

Callers 1

scaffoldProjectFunction · 0.85

Calls 4

installItemFunction · 0.85
writeMethod · 0.65

Tested by

no test coverage detected