Open Teajey opened 1 year ago
I am afraid you have to build that logic yourself. config-rs
does not support searching for configuration files, only loading and accessing them!
You could have a look at the xdg
or directories
crate or maybe at the walkdir
crate!
I use this pattern to load my config file
By default this only picks up a config file in the current directory, but I'm hoping to be able to run my program anywhere within a project that has ".myconfig" in the root directory. Is there a preferred way to do this?
My first thought is to successively
ConfigBuilder::build
in each parent directory up to/
every timeConfigError::NotFound
occurs; but that seems pretty naive