updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-08-23 19:24:10 -05:00
parent 84688f8166
commit fd71d5d452
4 changed files with 24 additions and 4 deletions

View File

@ -330,12 +330,16 @@ auto directory::remove() -> bool {
static_cast<const char *>(__FUNCTION__),
};
if (not exists()) {
return true;
}
return utils::retry_action([this]() -> bool {
try {
#if defined(_WIN32)
return (not exists() || ::RemoveDirectoryA(path_.c_str()));
return (::RemoveDirectoryA(path_.c_str()));
#else // !defined(_WIN32)
return not exists() || (rmdir(path_.c_str()) == 0);
return (rmdir(path_.c_str()) == 0);
#endif // defined(_WIN32)
} catch (const std::exception &e) {
utils::error::handle_exception(function_name, e);
@ -353,6 +357,10 @@ auto directory::remove_recursively() -> bool {
};
try {
if (not exists()) {
return true;
}
if (not traverse_directory(
path_,
[](auto dir_item) -> bool { return dir_item.remove_recursively(); },