added sarusctl user home config fallback#21
Conversation
|
@Madeeks I basically replaced the raster default config load to |
| } | ||
|
|
||
| fn config_dir_exists(path: &Path) -> Result<bool, AppError> { | ||
| match fs::metadata(path) { |
There was a problem hiding this comment.
Why not https://doc.rust-lang.org/std/fs/fn.exists.html?
To return a more detailed error type?
| } | ||
| } | ||
|
|
||
| fn ensure_default_user_config_dir() { |
There was a problem hiding this comment.
Is this needed?
If I'm not mistaken this is used only in the RasterOps test mock, but the related unit tests all create a custom user_dir.
For all the other tests, they shouldn't need a default path anyways because the mock loading function doesn't actually access the path.
Or am I missing something?
makes sarusctl usable with a per-user config directory at ~/.config/sarus-suite when /etc/sarus-suite is missing, without requiring raster any new search behavior as we implement the policy in sarusctl while the intrinsic implementation relies in raster.