Skip to content

Commit

Permalink
fix: hide the 'templates' dirName from user-facing options
Browse files Browse the repository at this point in the history
  • Loading branch information
BasKiers committed Apr 19, 2024
1 parent cd7ae42 commit 7689b6d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
}

Expand Down

0 comments on commit 7689b6d

Please sign in to comment.