Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmd to set key value in all config files #2

Closed
mozey opened this issue May 4, 2020 · 6 comments
Closed

Cmd to set key value in all config files #2

mozey opened this issue May 4, 2020 · 6 comments

Comments

@mozey
Copy link
Owner

mozey commented May 4, 2020

Usually it's a good idea to have the same keys across config files. That makes it easier to diff the files. If the key doesn't apply to the env then use the empty value.

This cmd might be invoked like this

./config -all -key APP_FOO -value xxx
@mozey
Copy link
Owner Author

mozey commented Jul 7, 2020

By default set value in all config files, pass in -env to update a specific file only This is a bad idea because it would require a file glob by default. Rather stick with -all as above

@mozey
Copy link
Owner Author

mozey commented Jul 15, 2020

This will require changes to Main, Cmd and Process functions

@mozey
Copy link
Owner Author

mozey commented Aug 19, 2021

#18

@mozey
Copy link
Owner Author

mozey commented Aug 23, 2021

The -all flag will set a key value for all config.*.json and sample.config.*.json files in APP_DIR.

To set only config.*.json maybe use this syntax...

configu -env * -key APP_FOO -value xxx

...or for sample files only

configu -env sample.* -key APP_FOO -value xxx

@mozey
Copy link
Owner Author

mozey commented Aug 23, 2021

Note, currently updating a key value replaces the entire contents of a file. Config files should be small (kilobytes) in most cases, so that is not a problem?

@mozey
Copy link
Owner Author

mozey commented Aug 31, 2021

Done

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

No branches or pull requests

1 participant