diff --git a/directory-deleter/Models/DirectoryModel.cs b/directory-deleter/Models/DirectoryModel.cs index 299fa2e..283e12f 100644 --- a/directory-deleter/Models/DirectoryModel.cs +++ b/directory-deleter/Models/DirectoryModel.cs @@ -61,7 +61,7 @@ await Task.Run(async () => foreach (string directory in subdirs) { Log.Logger?.Debug($"Searching for {targetFolder} subdirectories in location {currentDirectory}"); - if (Path.GetFileName(directory) == targetFolder) + if (Path.GetDirectoryName(directory) == targetFolder) { await DeleteDirectoryAsync(directory); _deleteCount++;