| ... | ... | @@ -30,17 +30,17 @@ pub fn execute(args: [][]u8) !void { |
| 30 | 30 | var list = std.ArrayList(u.Module).init(gpa); |
| 31 | 31 | try common.collect_pkgs(top_module, &list); |
| 32 | 32 | |
| 33 | | try create_depszig(cachepath, top_module, &list); |
| 33 | try create_depszig(cachepath, dir, top_module, &list); |
| 34 | 34 | |
| 35 | 35 | if (bootstrap) return; |
| 36 | 36 | |
| 37 | | try create_lockfile(&list, cachepath); |
| 37 | try create_lockfile(&list, cachepath, dir); |
| 38 | 38 | |
| 39 | 39 | try diff_lockfile(); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | | pub fn create_depszig(cachepath: string, top_module: u.Module, list: *std.ArrayList(u.Module)) !void { |
| 43 | | const f = try std.fs.cwd().createFile("deps.zig", .{}); |
| 42 | pub fn create_depszig(cachepath: string, dir: std.fs.Dir, top_module: u.Module, list: *std.ArrayList(u.Module)) !void { |
| 43 | const f = try dir.createFile("deps.zig", .{}); |
| 44 | 44 | defer f.close(); |
| 45 | 45 | |
| 46 | 46 | const w = f.writer(); |
| ... | ... | @@ -116,8 +116,8 @@ pub fn create_depszig(cachepath: string, top_module: u.Module, list: *std.ArrayL |
| 116 | 116 | try w.writeAll("};\n"); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | | fn create_lockfile(list: *std.ArrayList(u.Module), path: string) !void { |
| 120 | | const fl = try std.fs.cwd().createFile("zigmod.lock", .{}); |
| 119 | fn create_lockfile(list: *std.ArrayList(u.Module), path: string, dir: std.fs.Dir) !void { |
| 120 | const fl = try dir.createFile("zigmod.lock", .{}); |
| 121 | 121 | defer fl.close(); |
| 122 | 122 | |
| 123 | 123 | const wl = fl.writer(); |