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