Add command to fix templates (#21)

* add command to fix templates

* replaceAll and lint fixes

* fixed menu

* fix lint command and run it

* add basic error handling for listing of templates

* CR suggestions

---------

Co-authored-by: Arwid Thornström <arwidt@gmail.com>
This commit is contained in:
Anders Gustafsson
2024-08-16 09:34:15 +02:00
committed by GitHub
co-authored by Arwid Thornström
parent bc9ba08e76
commit 724f3905ab
28 changed files with 248 additions and 14310 deletions
+7 -7
View File
@@ -18,8 +18,8 @@ export const getTestStacksInfo = async (
strings.trim(await system.run(`aws cloudformation list-stacks`))
);
const allStacks = await Promise.all(
stacks.StackSummaries.map(async item => {
const allStacks = (await Promise.all(
stacks.StackSummaries.map(async (item) => {
if (
item.StackName.indexOf('photowall-test-') > -1 &&
[
@@ -29,7 +29,7 @@ export const getTestStacksInfo = async (
'UPDATE_FAILED',
'CREATE_FAILED',
'CREATE_IN_PROGRESS',
'ROLLBACK_COMPLETE'
'ROLLBACK_COMPLETE',
].includes(item.StackStatus)
) {
try {
@@ -40,7 +40,7 @@ export const getTestStacksInfo = async (
)
)
);
const sourceStage = pipeline.pipeline.stages.filter(stage => {
const sourceStage = pipeline.pipeline.stages.filter((stage) => {
return stage.name === 'Source';
});
const branch =
@@ -53,7 +53,7 @@ export const getTestStacksInfo = async (
drift_status: item.DriftInformation.StackDriftStatus,
branch: branch,
updated: lastUpdated,
created: item.CreationTime
created: item.CreationTime,
};
} catch (e) {
return {
@@ -62,12 +62,12 @@ export const getTestStacksInfo = async (
drift_status: '',
branch: '',
updated: '',
created: item.CreationTime
created: item.CreationTime,
};
}
}
return Promise.resolve(null);
})
) as Stack[] | null;
)) as Stack[] | null;
return allStacks.filter(Boolean);
};