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

Function getStaticTemplateDir

packages/cli/src/commands/init.ts:190–198  ·  view source on GitHub ↗
(templateId: string)

Source from the content-addressed store, hash-verified

188// Dev-mode also checks registry/examples/<id> so that smoke CI tests pick up
189// PR-branch template changes before the PR is merged to main.
190function getStaticTemplateDir(templateId: string): string {
191 const base = dirname(fileURLToPath(import.meta.url));
192 const devPath = resolve(base, "..", "templates", templateId);
193 if (existsSync(devPath)) return devPath;
194 // fallback: repo-root registry/examples/<id> (4 levels up from src/commands/)
195 const registryPath = resolve(base, "..", "..", "..", "..", "registry", "examples", templateId);
196 if (existsSync(registryPath)) return registryPath;
197 return resolve(base, "templates", templateId);
198}
199
200function getSharedTemplateDir(): string {
201 return resolveAssetDir(["..", "templates", "_shared"], ["templates", "_shared"]);

Callers 1

scaffoldProjectFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected