diff --git a/packages/contentful--create-contentful-app/src/includeFunction.ts b/packages/contentful--create-contentful-app/src/includeFunction.ts index 9930b0459..7db82d317 100644 --- a/packages/contentful--create-contentful-app/src/includeFunction.ts +++ b/packages/contentful--create-contentful-app/src/includeFunction.ts @@ -12,7 +12,7 @@ const addBuildCommand = getAddBuildCommandFn({ }); const VALID_FUNCTION_TEMPLATES_DIRS = [ - 'templates', + 'external-references', 'appevent-filter', 'appevent-handler', 'appevent-transformation', @@ -20,7 +20,6 @@ const VALID_FUNCTION_TEMPLATES_DIRS = [ 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( @@ -29,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; }