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
@@ -8,7 +8,7 @@ import {
defaultMenuSettings,
getCurrentBranch,
getSettings,
sleep
sleep,
} from '../../../../globals';
type Stack = {
@@ -30,7 +30,7 @@ const getBranchName = async (
type: 'input',
name: 'branch',
message: 'What github branch should be deployed?',
initial: currentBranch
initial: currentBranch,
});
const responseBranch = await input.run();
@@ -43,7 +43,7 @@ const getBranchName = async (
{
owner: 'photowall',
repo: 'photowall',
branch: responseBranch
branch: responseBranch,
}
);
if (response.status === 200) {
@@ -60,7 +60,7 @@ const getConfirmation = async (branchName: string, stackName: string) => {
name: 'confirm',
message: `The branch ${chalk.green(
branchName
)} will deploy to ${chalk.yellow(stackName)}`
)} will deploy to ${chalk.yellow(stackName)}`,
});
try {
@@ -101,7 +101,7 @@ module.exports = {
}
const testStacks = await getTestStacksInfo(toolbox);
const options = testStacks.map(item => {
const options = testStacks.map((item) => {
return item.name;
});
@@ -110,7 +110,7 @@ module.exports = {
message: 'Choose a server',
limit: options.length - 1,
initial: options.length - 1,
choices: options
choices: options,
});
try {
@@ -128,7 +128,7 @@ module.exports = {
);
const output = await system.run(cmd, {
cwd: `${config.photowall_repo}/cloudformation/`,
trim: true
trim: true,
});
print.fancy(output);
@@ -185,5 +185,5 @@ module.exports = {
} else {
exit();
}
}
},
};