Closed julianandrews closed 1 year ago
This PR is should resolve #47.
Do you think you could also handle #44? Given we aren't really checking much in the constructor now.
Do you think you could also handle #44? Given we aren't really checking much in the constructor now.
Sure. I'll get a PR together sometime this weekend.
I think this change would let me add the test case I was missing for the this PR!
Move failures to call time rather than
BaseDirectories
creation.This means, for instance, that
create_config_directory()
can work ifXDG_CONFIG_HOME
is defined even ifHOME
isn't.This also means that methods like
find_data_file()
andfind_config_file()
will work without a home directory, which can be useful for software that wants to support both use by regular users and use by system accounts withoutHOME
.I tried to write a test case, but
std::env::home_dir()
will figure out the home dir even ifHOME
is unset, which makes meaningful testing quite difficult.