From 7689b6dd9f1fb2af0834a6984ab9024b3fe09bc7 Mon Sep 17 00:00:00 2001 From: Bas Kiers Date: Fri, 19 Apr 2024 14:50:18 +0200 Subject: [PATCH] fix: hide the 'templates' dirName from user-facing options --- .../contentful--create-contentful-app/src/includeFunction.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/contentful--create-contentful-app/src/includeFunction.ts b/packages/contentful--create-contentful-app/src/includeFunction.ts index 07b5ed789..59338b10a 100644 --- a/packages/contentful--create-contentful-app/src/includeFunction.ts +++ b/packages/contentful--create-contentful-app/src/includeFunction.ts @@ -16,12 +16,10 @@ const VALID_FUNCTION_TEMPLATES_DIRS = [ 'appevent-handler', 'appevent-transformation', 'external-references', - 'templates', ]; function functionTemplateFromName(functionName: string) { let dirName = functionName; - if (functionName === 'external-references') dirName = 'templates'; // backwards compatible for the apps repo examples folder for delivery functions (external-references) if (!VALID_FUNCTION_TEMPLATES_DIRS.includes(dirName)) { console.error( `Invalid function template: ${functionName}. Must be one of ${VALID_FUNCTION_TEMPLATES_DIRS.join( @@ -30,6 +28,7 @@ function functionTemplateFromName(functionName: string) { ); process.exit(1); } + if (functionName === 'external-references') dirName = 'templates'; // backwards compatible for the apps repo examples folder for delivery functions (external-references) return dirName; }