Skip to content

Commit eda7653

Browse files
l2yshoclaude
andcommitted
fix(create): accept template id as well as name in --template
`--template` matched only the manifest `name`, but the new `--json` payload reports the template `id` — and 19 of 43 templates have `id !== name`, so the value the machine-readable output emits was rejected on round-trip. The `--help` example `--template js-crawlee-cheerio` was broken for the same reason. Resolve against either field. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 97b59e0 commit eda7653

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/lib/create-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export async function getTemplateDefinition(
4747
if (manifest instanceof Error) throw manifest;
4848

4949
if (maybeTemplateName) {
50-
const templateDefinition = manifest.templates.find((t) => t.name === maybeTemplateName);
50+
// Accept both the template name and its id — `--json` output and older docs reference the id.
51+
const templateDefinition = manifest.templates.find(
52+
(t) => t.name === maybeTemplateName || t.id === maybeTemplateName,
53+
);
5154
if (!templateDefinition) {
5255
throw new Error(`Could not find the selected template: ${maybeTemplateName} in the list of templates.`);
5356
}

0 commit comments

Comments
 (0)