Skip to content

Commit adbf95a

Browse files
gurobokumkaustavghosh06
authored andcommitted
fix(amplify-provider-awscloudformation): filter by template extensions (#1596)
1 parent 8c9a3cd commit adbf95a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/amplify-provider-awscloudformation/lib/push-resources.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ function packageResources(context, resources) {
231231

232232
const files = fs.readdirSync(resourceDir);
233233
// Fetch all the Cloudformation templates for the resource (can be json or yml)
234-
const cfnFiles = files.filter(file => file.indexOf('template') !== -1);
234+
const cfnFiles = files.filter(file =>
235+
(file.indexOf('template') !== -1) && /\.(json|yaml|yml)$/.test(file));
235236

236237
if (cfnFiles.length !== 1) {
237238
context.print.error('Only one CloudFormation template is allowed in the resource directory');

0 commit comments

Comments
 (0)