diff --git a/packages/cli/src/commands/lambda/prebuiltHandler.ts b/packages/cli/src/commands/lambda/prebuiltHandler.ts index a1b4e178ec..0be52c6c5d 100644 --- a/packages/cli/src/commands/lambda/prebuiltHandler.ts +++ b/packages/cli/src/commands/lambda/prebuiltHandler.ts @@ -91,10 +91,9 @@ export async function stagePrebuiltHandler(deps: StageDeps = defaultDeps): Promi renameSync(partial, zip); deps.log(`→ Verified sha256 ${pinned.sha256}`); } - // The template and the nested templates it deploys (video-function.yaml). - const templates = dirname(pinned.templatePath); - for (const file of readdirSync(templates).filter((name) => name.endsWith(".yaml"))) { - copyFileSync(join(templates, file), join(dir, file)); + const templateDir = dirname(pinned.templatePath); + for (const file of readdirSync(templateDir).filter((name) => name.endsWith(".yaml"))) { + copyFileSync(join(templateDir, file), join(dir, file)); } return dir; }