| ... | @@ -10,7 +10,7 @@ const u = @import("./util/index.zig"); | ... | @@ -10,7 +10,7 @@ const u = @import("./util/index.zig"); |
| 10 | pub fn execute(args: [][]u8) !void { | 10 | pub fn execute(args: [][]u8) !void { |
| 11 | // | 11 | // |
| 12 | const home = try known_folders.getPath(gpa, .home); | 12 | const home = try known_folders.getPath(gpa, .home); |
| 13 | const dir = try std.fs.path.join(gpa, &[_][]const u8{home.?, ".cache", "zigmod"}); | 13 | const dir = try std.fs.path.join(gpa, &[_][]const u8{home.?, ".cache", "zigmod", "deps"}); |
| 14 | | 14 | |
| 15 | const top_module = try fetch_deps(dir, "./zig.mod"); | 15 | const top_module = try fetch_deps(dir, "./zig.mod"); |
| 16 | | 16 | |
| ... | @@ -23,7 +23,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -23,7 +23,7 @@ pub fn execute(args: [][]u8) !void { |
| 23 | try w.print("const build = std.build;\n", .{}); | 23 | try w.print("const build = std.build;\n", .{}); |
| 24 | try w.print("\n", .{}); | 24 | try w.print("\n", .{}); |
| 25 | try w.print("const home = \"{}\";\n", .{home}); | 25 | try w.print("const home = \"{}\";\n", .{home}); |
| 26 | try w.print("const cache = home ++ \"/.cache/zigmod\";\n", .{}); | 26 | try w.print("const cache = home ++ \"/.cache/zigmod/deps\";\n", .{}); |
| 27 | try w.print("\n", .{}); | 27 | try w.print("\n", .{}); |
| 28 | try w.print("{}\n", .{ | 28 | try w.print("{}\n", .{ |
| 29 | \\pub fn addAllTo(exe: *build.LibExeObjStep) void { | 29 | \\pub fn addAllTo(exe: *build.LibExeObjStep) void { |
| ... | @@ -64,7 +64,7 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module { | ... | @@ -64,7 +64,7 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module { |
| 64 | const moduledeps = &std.ArrayList(u.Module).init(gpa); | 64 | const moduledeps = &std.ArrayList(u.Module).init(gpa); |
| 65 | var moddir: []const u8 = undefined; | 65 | var moddir: []const u8 = undefined; |
| 66 | for (m.deps) |d| { | 66 | for (m.deps) |d| { |
| 67 | const p = try u.concat(&[_][]const u8{dir, "/deps/", try d.clean_path()}); | 67 | const p = try u.concat(&[_][]const u8{dir, "/", try d.clean_path()}); |
| 68 | const pv = try u.concat(&[_][]const u8{dir, "/v/", try d.clean_path(), "/", d.version}); | 68 | const pv = try u.concat(&[_][]const u8{dir, "/v/", try d.clean_path(), "/", d.version}); |
| 69 | u.print("fetch: {}: {}: {}", .{m.name, @tagName(d.type), d.path}); | 69 | u.print("fetch: {}: {}: {}", .{m.name, @tagName(d.type), d.path}); |
| 70 | moddir = p; | 70 | moddir = p; |