Skip to content

Commit

Permalink
remapKeysInEnv function on cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cwdcwd committed Nov 25, 2021
1 parent 8a49b97 commit 67cebe7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ function displayHelp() {
{bold.blue * --newprefix} prefix to replace with
{underline.green saveParamsFile:} save params to a file so that they can be loaded in another process via {italic.blue source} command
{bold.blue * --outfile} file to save the aws env vars to
{bold.blue * --env} aws application environment if source is aws
{bold.blue * --service} aws application service if source is aws
{bold.blue * --env} aws application environment
{bold.blue * --service} aws application service
`)
}

async function remapKeysInEnv(config) {
console.log(chalk.green('Remapping keys in env'))
const params = configWrapper.envLoader.remapKeysInEnv(config.oldprefix, config.newprefix)
console.log(chalk.green(`Saving ${params.length} parameters to ${config.outfile}`))
configWrapper.envLoader.paramsToSourceFile(params, config.outfile)
console.log(chalk.green(`Saved ${params.length} parameters to ${config.outfile}`))
}

async function saveParamsFile(config) {
Expand Down Expand Up @@ -167,7 +171,6 @@ async function cli(args) {
console.log(chalk.green(`\n${pkg.name} v${pkg.version}`))
let options = parseArgumentsIntoOptions(args)
options = await promptForMissingOptions(options)
console.log(options)

if (options) {
await options.commandFunc(options)
Expand Down

0 comments on commit 67cebe7

Please sign in to comment.