| ... | ... | @@ -317,16 +317,6 @@ pub fn add_files_package(alloc: *std.mem.Allocator, pkg_name: string, mdir: std. |
| 317 | 317 | while (iter.next()) |item| { |
| 318 | 318 | try w.print("pub const @\"/{}\" = @embedFile(srcpath ++ \"/{}\");\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) }); |
| 319 | 319 | } |
| 320 | | try w.writeAll("\n"); |
| 321 | | try w.writeAll( |
| 322 | | \\pub fn open(comptime path: string) ?string { |
| 323 | | \\ if (path.len == 0) return null; |
| 324 | | \\ if (path[0] != '/') return null; |
| 325 | | \\ if (!@hasDecl(@This(), path)) return null; |
| 326 | | \\ return @field(@This(), path); |
| 327 | | \\} |
| 328 | | \\ |
| 329 | | ); |
| 330 | 320 | |
| 331 | 321 | var d: zigmod.Dep = .{ |
| 332 | 322 | .alloc = alloc, |