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
+15 -9
View File
@@ -24,13 +24,13 @@ module.exports = {
print.info(
chalk.yellow(`
This will help you setup everything needed to run pwcli on a mac (maby linux).
All settings will be saved to ${chalk.cyan('~/.pwcli_settings')}
First step is to install aws cli [https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html]
and configuring it. Install it either with brew or do as specified in the link.
`)
);
@@ -108,7 +108,8 @@ module.exports = {
if (!config) {
config = {
gh_token: '',
photowall_repo: ''
photowall_repo: '',
mandrill_api_key: '',
};
}
@@ -116,24 +117,29 @@ module.exports = {
message: `A github accesstoken is required with ${chalk.yellow(
'Full control of private repositories'
)}, please insert the key >`,
initial: config.gh_token
initial: config.gh_token,
}).run();
config.photowall_repo = await new Input({
message: `If you want to be able to use current branch in your photowall repository\nor the create and update commands for testservers, please insert\nthe absolute path to the project or leave blank >`,
initial: config.photowall_repo
initial: config.photowall_repo,
}).run();
config.mandrill_api_key = await new Input({
message: `If you want to be able to use the mailchimp commands, please insert\nyour mailchimp api key. Otherwise leave blank >`,
initial: config.mandrill_api_key,
}).run();
print.info(`
${JSON.stringify(config)}
`);
if (
await new Confirm({
message: `Ok to save the these settings to ${chalk.yellow(
`~/.pwcli_settings`
)}?`
)}?`,
}).run()
) {
await system.run(`echo '${JSON.stringify(config)}' > ~/.pwcli_settings`);
@@ -145,5 +151,5 @@ module.exports = {
if (toolbox.fromMenu())
await toolbox.menu.showMenu(null, defaultMenuSettings);
}
},
};