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

how can I modify the file when I change the Config? #453

Open
lizhecao opened this issue Feb 18, 2017 · 3 comments
Open

how can I modify the file when I change the Config? #453

lizhecao opened this issue Feb 18, 2017 · 3 comments

Comments

@lizhecao
Copy link

I found that there is not method such as ConfigFactory.writeFile ?how can I modify the .conf file after I use the withValue to get the new Config?

@havocp
Copy link
Collaborator

havocp commented Feb 18, 2017

The library has limited support for that since it's made for hand-writtten config files.

There is a class ConfigDocument which has some limited API for changing the syntax tree.

There is also a render() method on config objects but it will not preserve formatting.

There is an open issue about adding more capability to ConfigDocument which is where enhancements to support writing files should go.

Another option is to keep a separate JSON file with machine edits rather than changing the .conf file.

@ghost
Copy link

ghost commented Jan 25, 2019

Almost two years later and still no progress made on being able to write to configs. Common guys. What's a configuration implementation without support for writing to configs? 🥺

@havocp
Copy link
Collaborator

havocp commented Jan 25, 2019

We need someone to work on this for it to happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants