Change File::DeleteDir return value

Makes File::DeleteDir return true when attempting to delete a
nonexistent path.

The purpose of DeleteDir is to ensure the path doesn't exist after the
call, which is better reflected by the new return value. Additionally,
none of the current callers actually check the return value so this
won't break any existing code.
This commit is contained in:
Dentomologist 2020-12-03 13:07:17 -08:00
parent a34823df61
commit c434eefe94

View File

@ -257,6 +257,13 @@ bool DeleteDir(const std::string& filename)
{
INFO_LOG_FMT(COMMON, "DeleteDir: directory {}", filename);
// Return true because we care about the directory not being there, not the actual delete.
if (!File::Exists(filename))
{
WARN_LOG_FMT(COMMON, "DeleteDir: {} does not exist", filename);
return true;
}
// check if a directory
if (!IsDirectory(filename))
{