authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2021-01-09 17:01:34 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2021-01-09 17:01:34 -08:00
log74026e975f172fa0f90c5ff3d15aacd692f708b7
treecefa85ca38e6d36f1352a0d80f3cffaeeb4cfa67
parentd4c9a90f1a871a916b5c987dd1b4537cd61b9e0d

fetch: wasnt printing null if dep had c deps


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

src/cmd_fetch.zig+1-1
......@@ -263,7 +263,7 @@ fn print_paths(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]const u8
263263}
264264
265265fn print_deps(w: fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, array: bool) anyerror!void {
266 if (m.deps.len == 0 and tabs > 0) {
266 if (m.has_no_zig_deps() and tabs > 0) {
267267 try w.print("null", .{});
268268 return;
269269 }
src/util/module.zig+9
......@@ -83,4 +83,13 @@ pub const Module = struct {
8383 }
8484 return true;
8585 }
86
87 pub fn has_no_zig_deps(self: Module) bool {
88 for (self.deps) |d| {
89 if (d.main.len > 0) {
90 return false;
91 }
92 }
93 return true;
94 }
8695};