-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Would you consider modification of config files? #29
Comments
Hi. I'm sorry but I think you need to provide a bit more context. What do you mean by "modification of config files"? |
In the end, I want to provide a |
Ah I see. That makes sense. This is something I very likely will consider for However, already now I am not sure how well confique can support it. Just serializing the whole configuration and writing it to the file again is fairly easy, but overwrites the whole file. That means that comments made by the user for example are overwritten. I am not sure confique will ever support this "only change what's necessary but keep the original file as much as possible". It's not easy. Would that be a requirement for you? But yes, the basic "write an in-memory config to file" will certainly be supported. Likely also with the option to write or not write default values and the like. |
I would want to keep comments and such, but that would require to not use serde for the writing but a different trait that could ask a Config provider to only write the changes but keep the rest of the file as is without breaking any formatting or comments. For toml this could be achieved with |
Yep :/ I am very sure that |
I experimented a bit, and it looks like it wouldn't be too terrible to do a serde serializer that preservers the original data if possible: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=dbda15adfbdf58defcaf2c5707a3a033 It uses Granted this is only a very incomplete implementation for |
I combined multiple issues into one: #41 |
It's a project I'm currently planing but haven't really found how I want to do yet, and I stumbled upon this crate looking for a name.
The text was updated successfully, but these errors were encountered: