support 0.9 and master (#561)

This commit is contained in:
Lee Cannon 2022-07-24 22:08:14 +01:00 committed by GitHub
parent 644ded72d2
commit 98e5451d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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