From 7369ad887cf6055192c9234d8eec1550dfabd883 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 7 May 2025 07:52:32 +0100 Subject: added logic to handle empty directories correctly (#383) * added logic to handle empty directories correctly --- src/zen/cmds/wipe_cmd.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/zen/cmds/wipe_cmd.cpp b/src/zen/cmds/wipe_cmd.cpp index 9bf0c6f9e..269f95417 100644 --- a/src/zen/cmds/wipe_cmd.cpp +++ b/src/zen/cmds/wipe_cmd.cpp @@ -283,7 +283,18 @@ namespace { { DiscoveredItemCount++; } - if (!Content.FileNames.empty()) + if (Content.FileNames.empty()) + { + const std::filesystem::path ParentPath = Path / RelativeRoot; + bool KeepDirectory = RelativeRoot.empty(); + + bool Added = AddFoundDirectoryFunc(ParentPath, KeepDirectory); + if (Added) + { + ZEN_CONSOLE_VERBOSE("{} directory {}", KeepDirectory ? "Keeping" : "Removing", ParentPath); + } + } + else { DiscoveredItemCount += Content.FileNames.size(); -- cgit v1.2.3