Skip to content

Commit

Permalink
only prompt to write if keys are generated
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Nov 10, 2020
1 parent 58bdef8 commit 77b60eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/cli_encryption_key/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export async function generate(encryptionConfig, command) {
logger.log('No keys to write. Use the --force flag to generate new keys.');
} else {
logger.log(safeDump(keys));
}

if (command.interactive) {
const write = await confirm('Write to kibana.yml?');
if (write) {
const kibanaYML = join(getConfigDirectory(), 'kibana.yml');
appendFileSync(kibanaYML, safeDump(keys));
logger.log(`Wrote ${Object.keys(keys).length} settings to kibana.yml.`);
if (command.interactive) {
const write = await confirm('Write to kibana.yml?');
if (write) {
const kibanaYML = join(getConfigDirectory(), 'kibana.yml');
appendFileSync(kibanaYML, safeDump(keys));
logger.log(`Wrote ${Object.keys(keys).length} settings to kibana.yml.`);
}
}
}
if (command.force && !command.quiet) {
Expand Down

0 comments on commit 77b60eb

Please sign in to comment.