| ... | ... | @@ -9,6 +9,8 @@ const time = @import("time"); |
| 9 | 9 | const extras = @import("extras"); |
| 10 | 10 | |
| 11 | 11 | const u = @import("./../util/funcs.zig"); |
| 12 | const common = @import("./../common.zig"); |
| 13 | const zigmod = @import("./../lib.zig"); |
| 12 | 14 | |
| 13 | 15 | // |
| 14 | 16 | // |
| ... | ... | @@ -288,6 +290,26 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void { |
| 288 | 290 | ); |
| 289 | 291 | } |
| 290 | 292 | } |
| 293 | |
| 294 | // write a deps.zig |
| 295 | { |
| 296 | const alloc = gpa; |
| 297 | const cachepath = try u.find_cachepath(); |
| 298 | const dir = std.fs.cwd(); |
| 299 | |
| 300 | var options = common.CollectOptions{ |
| 301 | .log = true, |
| 302 | .update = false, |
| 303 | .alloc = alloc, |
| 304 | }; |
| 305 | const top_module = try common.collect_deps_deep(cachepath, dir, &options); |
| 306 | |
| 307 | var list = std.ArrayList(zigmod.Module).init(alloc); |
| 308 | try common.collect_pkgs(top_module, &list); |
| 309 | |
| 310 | const fetch = @import("./fetch.zig"); |
| 311 | try fetch.create_depszig(alloc, cachepath, dir, top_module, &list); |
| 312 | } |
| 291 | 313 | } |
| 292 | 314 | |
| 293 | 315 | pub fn writeExeManifest(w: std.fs.File.Writer, id: string, name: string, license: ?string, description: ?string) !void { |