Fix DefaultIOManager bugs

- Fix `CreateResolverForSubdirectory` not considering if the input path was rooted.
- Fix `DeleteDirectory` not resolving the input path.
This commit is contained in:
Jordan Dominion
2025-07-26 20:08:31 -04:00
parent 5a37c36c65
commit 0d4d68d736
@@ -162,7 +162,8 @@ namespace Tgstation.Server.Host.IO
=> Task.Factory.StartNew(
() =>
{
var di = fileSystem.DirectoryInfo.New(path);
var di = fileSystem.DirectoryInfo.New(
ResolvePath(path));
if (di.Exists)
NormalizeAndDelete(di, cancellationToken);
},
@@ -416,11 +417,14 @@ namespace Tgstation.Server.Host.IO
{
ArgumentNullException.ThrowIfNull(subdirectoryPath);
if (!Path.IsPathRooted(subdirectoryPath))
subdirectoryPath = ConcatPath(
ResolvePath(),
subdirectoryPath);
return new ResolvingIOManager(
fileSystem,
ConcatPath(
ResolvePath(),
subdirectoryPath));
subdirectoryPath);
}
/// <summary>