Skip to content

feat(generate-config): add overwrite flag and change default env file#1604

Merged
rkpattnaik780 merged 1 commit intomainfrom
env_file_fix
Jun 21, 2022
Merged

feat(generate-config): add overwrite flag and change default env file#1604
rkpattnaik780 merged 1 commit intomainfrom
env_file_fix

Conversation

@rkpattnaik780
Copy link
Contributor

The default file to save configuration details in environment variables has been changed from rhoas.env to .env
A --overwrite flag has been added to warn of already existing file.

Verification Steps

  1. The following command should save connection configurations in a .env file:
rhoas generate-config --type env
  1. Running the command again should throw the following error:
File `.env` already exists. Use --overwrite to overwrite the file, or the --output-file flag to choose a different location.
  1. The existing file can be overridden using the --overwrite flag.
rhoas generate-config --type env --overwrite

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)


[generate.error.configFileAlreadyExists]
description = 'Error message for when a configuration file alredy exists at a location'
one = 'file {{.FilePath}} already exists. Use --overwrite to overwrite the file, or the --output-file flag to choose a different location'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
one = 'file {{.FilePath}} already exists. Use --overwrite to overwrite the file, or the --output-file flag to choose a different location'
one = 'file {{.FilePath}} already exists. Use --overwrite flag to overwrite the file, or the --output-file flag to choose a different location'

one='Type of configuration file to be generated'

[generate.flag.overwrite.description]
one = 'Forcibly overwrite a configuration file if it already exists'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
one = 'Forcibly overwrite a configuration file if it already exists'
one = 'Overwrite a configuration file if it already exists'

@wtrocki
Copy link
Collaborator

wtrocki commented Jun 17, 2022

CC @jackdelahunt for verification

@jackdelahunt
Copy link
Contributor

@rkpattnaik780 Looks good to me 👍

@rkpattnaik780 rkpattnaik780 merged commit 523a7dd into main Jun 21, 2022
@rkpattnaik780 rkpattnaik780 deleted the env_file_fix branch June 21, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants