| 231 | } |
| 232 | |
| 233 | static fs::path tryPathOrDefault(fs::path pathToTry, PathId defaultPathId) |
| 234 | { |
| 235 | if (!pathToTry.empty()) |
| 236 | { |
| 237 | // Getting the directory can fail if config is bad. |
| 238 | try |
| 239 | { |
| 240 | if (fs::is_directory(pathToTry)) |
| 241 | { |
| 242 | return pathToTry; |
| 243 | } |
| 244 | } |
| 245 | catch (std::system_error&) |
| 246 | { |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | // NB: vanilla routines do not use std::filesystem yet, so the trailing slash is still needed. |
| 251 | auto defaultPath = getDefaultPathNoWarning(defaultPathId) / ""; |
| 252 | autoCreateDirectory(defaultPath); |
| 253 | return defaultPath; |
| 254 | } |
| 255 | |
| 256 | // 0x004412CE |
| 257 | void resolvePaths() |
no test coverage detected