From 8eb58132eb02c843a54ec7baa6337f54dd024648 Mon Sep 17 00:00:00 2001 From: Guillaume Wenzek Date: Sun, 15 Jun 2025 23:03:26 +0200 Subject: [PATCH] fix top level in tar file --- src/Package/Fetch.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig index 9acfe1d97acd..86c99ed348de 100644 --- a/src/Package/Fetch.zig +++ b/src/Package/Fetch.zig @@ -527,7 +527,8 @@ fn runResource( // directory. f.computed_hash = try computeHash(f, pkg_path, filter); - break :blk if (unpack_result.root_dir.len > 0) + const dot_root_dir = unpack_result.root_dir.len == 1 and unpack_result.root_dir[0] == '.'; + break :blk if (unpack_result.root_dir.len > 0 and !dot_root_dir) try fs.path.join(arena, &.{ tmp_dir_sub_path, unpack_result.root_dir }) else tmp_dir_sub_path;