From 0026f0cb4c5d92709678f0389f898f702dd7beeb Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 9 Jul 2024 13:53:06 -0700 Subject: [PATCH] try to clean up empty directories (this does not always work...) --- build.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 682e87a..0c7cef1 100644 --- a/build.zig +++ b/build.zig @@ -92,9 +92,17 @@ pub fn build(b: *std.Build) void { "-rf", ".unikraft", }); + + // rm -rf in this manner is leaving empty .unikraft/build, which is confusing + // let's whack it + const remove_empties_cmd = b.addSystemCommand(&[_][]const u8{ + "find", ".unikraft", "-type", "d", "-empty", "-delete", + }); + remove_empties_cmd.step.dependOn(&distclean_cmd.step); + const distclean_step = b.step("distclean", "Deep clean the unikraft build"); distclean_step.dependOn(clean_step); - distclean_step.dependOn(&distclean_cmd.step); + distclean_step.dependOn(&remove_empties_cmd.step); } const LazyPathEnvironmentVariable = struct {