(templateId: string)
| 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. |
| 190 | function 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 | |
| 200 | function getSharedTemplateDir(): string { |
| 201 | return resolveAssetDir(["..", "templates", "_shared"], ["templates", "_shared"]); |
no test coverage detected