authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 12:42:21 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 12:42:21 -08:00
logc7650267c0dbc69dcd61fd8a0d922e1dcba818dd
tree609f1cec133fbeb5c15f846ad3b33baef2945aa4
parentdaf19da2600d7f96516def657b5ca04e6c74e0aa

switch back to using deps folder


2 files changed, 4 insertions(+), 4 deletions(-)

src/cmd_fetch.zig+3-3
...@@ -10,7 +10,7 @@ const u = @import("./util/index.zig");...@@ -10,7 +10,7 @@ const u = @import("./util/index.zig");
10pub fn execute(args: [][]u8) !void {10pub 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"});
1414
15 const top_module = try fetch_deps(dir, "./zig.mod");15 const top_module = try fetch_deps(dir, "./zig.mod");
1616
...@@ -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;
src/cmd_sum.zig+1-1
...@@ -11,7 +11,7 @@ const common = @import("./common.zig");...@@ -11,7 +11,7 @@ const common = @import("./common.zig");
11pub fn execute(args: [][]u8) !void {11pub fn execute(args: [][]u8) !void {
12 //12 //
13 const home = try known_folders.getPath(gpa, .home);13 const home = try known_folders.getPath(gpa, .home);
14 const dir = try std.fs.path.join(gpa, &[_][]const u8{home.?, ".cache", "zigmod"});14 const dir = try std.fs.path.join(gpa, &[_][]const u8{home.?, ".cache", "zigmod", "deps"});
15 const top_module = try common.collect_deps(dir, "./zig.mod");15 const top_module = try common.collect_deps(dir, "./zig.mod");
16 16
17 //17 //