| ... | ... | @@ -305,11 +305,7 @@ pub fn add_files_package(alloc: std.mem.Allocator, cachepath: string, pkg_name: |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | | const cwdpath = try std.fs.cwd().realpathAlloc(alloc, "."); |
| 309 | | const mpath = try mdir.realpathAlloc(alloc, "."); |
| 310 | | var fpath = extras.trimPrefix(mpath, cwdpath); |
| 311 | | if (fpath.len == 0) fpath = std.fs.path.sep_str; |
| 312 | | |
| 308 | const fpath = try mdir.realpathAlloc(alloc, "."); |
| 313 | 309 | var cachedir = try std.fs.cwd().openDir(cachepath, .{}); |
| 314 | 310 | defer cachedir.close(); |
| 315 | 311 | try cachedir.makePath("files"); |
| ... | ... | @@ -318,7 +314,7 @@ pub fn add_files_package(alloc: std.mem.Allocator, cachepath: string, pkg_name: |
| 318 | 314 | const rff = try destdir.createFile(fname, .{}); |
| 319 | 315 | defer rff.close(); |
| 320 | 316 | const w = rff.writer(); |
| 321 | | try w.print("const srcpath = \"../../../{}\";\n\n", .{std.zig.fmtEscapes(fpath[1..])}); |
| 317 | try w.print("const srcpath = \"/{}\";\n\n", .{std.zig.fmtEscapes(fpath[1..])}); |
| 322 | 318 | var iter = map.iterator(); |
| 323 | 319 | while (iter.next()) |item| { |
| 324 | 320 | try w.print("pub const @\"/{}\" = @embedFile(srcpath ++ \"/{}\");\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) }); |