From 01a784d7b4c12296461adeb8aa157b3579523e42 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 9 Aug 2021 02:45:37 -0700 Subject: [PATCH] fix files package generation for new zig --- src/common.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common.zig b/src/common.zig index c196d15787e01eebca78c6cf1304b2ea547fc4ed..cd836212d9276ee61b1c7d4284583b2bbb90783f 100644 --- a/src/common.zig +++ b/src/common.zig @@ -289,7 +289,7 @@ pub fn add_files_package(pkg_name: []const u8, dirs: []const []const u8, parent_ continue; } const path = try std.mem.dupe(gpa, u8, p.path); - try map.put(path[dir_path.len..], path); + try map.put(path, try std.fmt.allocPrint(gpa, "{s}/{s}", .{ dir_path, path })); } } @@ -304,7 +304,7 @@ pub fn add_files_package(pkg_name: []const u8, dirs: []const []const u8, parent_ ); var iter = map.iterator(); while (iter.next()) |item| { - try w.print(" .{{ .@\"0\" = \"{}\", .@\"1\" = @embedFile(\"./../../../{}\") }},\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) }); + try w.print(" .{{ .@\"0\" = \"/{}\", .@\"1\" = @embedFile(\"./../../../{}\") }},\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) }); } try w.writeAll("\n"); try w.writeAll( -- 2.54.0