Build runner: Only output generated package path if it is available

This commit is contained in:
Alexandros Naskos 2021-06-16 14:47:54 +03:00
parent fdb5e8f9fb
commit a02c1e7996
No known key found for this signature in database
GPG Key ID: 02BF2E72B0EA32D2

View File

@ -54,7 +54,7 @@ fn processStep(stdout_stream: anytype, step: *std.build.Step) anyerror!void {
fn processPackage(out_stream: anytype, pkg: Pkg) anyerror!void {
switch (pkg.path) {
.path => |path| try out_stream.print("{s}\x00{s}\n", .{ pkg.name, path }),
.generated => |generated| try out_stream.print("{s}\x00{s}\n", .{ pkg.name, generated.getPath() }),
.generated => |generated| if (generated.path != null) try out_stream.print("{s}\x00{s}\n", .{ pkg.name, generated.path.? }),
}
if (pkg.dependencies) |dependencies| {