authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-21 01:08:52 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-21 01:08:52 -07:00
logd728c68f7d749d7a64c1d426fd7bbb4b79a4a63b
tree7477f0cedcb57d7e3262c626447d782050febe0b
parentbf4cc92d981de56b75bf6005cc66dea32d9d7eba

only make `.zigmod/deps/files` folder if package has files


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

src/common.zig+2-1
...@@ -32,8 +32,8 @@ pub fn collect_deps_deep(cachepath: []const u8, mpath: []const u8, options: *Col...@@ -32,8 +32,8 @@ pub fn collect_deps_deep(cachepath: []const u8, mpath: []const u8, options: *Col
32 try options.init();32 try options.init();
33 var moduledeps = std.ArrayList(u.Module).init(gpa);33 var moduledeps = std.ArrayList(u.Module).init(gpa);
34 defer moduledeps.deinit();34 defer moduledeps.deinit();
35 try std.fs.cwd().makePath(".zigmod/deps/files");
36 if (m.root_files.len > 0) {35 if (m.root_files.len > 0) {
36 try std.fs.cwd().makePath(".zigmod/deps/files");
37 try moduledeps.append(try add_files_package("root", m.root_files, m.name));37 try moduledeps.append(try add_files_package("root", m.root_files, m.name));
38 }38 }
39 try moduledeps.append(try collect_deps(cachepath, mpath, options));39 try moduledeps.append(try collect_deps(cachepath, mpath, options));
...@@ -59,6 +59,7 @@ pub fn collect_deps(cachepath: []const u8, mpath: []const u8, options: *CollectO...@@ -59,6 +59,7 @@ pub fn collect_deps(cachepath: []const u8, mpath: []const u8, options: *CollectO
59 var moduledeps = std.ArrayList(u.Module).init(gpa);59 var moduledeps = std.ArrayList(u.Module).init(gpa);
60 defer moduledeps.deinit();60 defer moduledeps.deinit();
61 if (m.files.len > 0) {61 if (m.files.len > 0) {
62 try std.fs.cwd().makePath(".zigmod/deps/files");
62 try moduledeps.append(try add_files_package(m.id, m.files, m.name));63 try moduledeps.append(try add_files_package(m.id, m.files, m.name));
63 }64 }
64 for (m.deps) |*d| {65 for (m.deps) |*d| {