aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-05-07 07:52:32 +0100
committerGitHub Enterprise <[email protected]>2025-05-07 08:52:32 +0200
commit7369ad887cf6055192c9234d8eec1550dfabd883 (patch)
tree9d7530225b18ef08889cb0886bab36b920ddf893 /src
parentoptimize cache bucket state writing (#382) (diff)
downloadzen-7369ad887cf6055192c9234d8eec1550dfabd883.tar.xz
zen-7369ad887cf6055192c9234d8eec1550dfabd883.zip
added logic to handle empty directories correctly (#383)
* added logic to handle empty directories correctly
Diffstat (limited to 'src')
-rw-r--r--src/zen/cmds/wipe_cmd.cpp13
1 files changed, 12 insertions, 1 deletions
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();