Skip to content

Commit

Permalink
fix(#28): Don't add examples step if examples dir is missing
Browse files Browse the repository at this point in the history
Signed-off-by: prajwalch <[email protected]>
  • Loading branch information
prajwalch committed Sep 16, 2024
1 parent 4778cb0 commit 607c471
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ fn testStep(b: *std.Build) void {
}

fn examplesStep(b: *std.Build, yazap: *std.Build.Module) void {
const step = b.step("examples", "Build all the examples");

var dir = std.fs.cwd().openDir("./examples/", .{ .iterate = true }) catch @panic(
"failed to open examples dir",
);
var dir = std.fs.cwd().openDir("./examples/", .{ .iterate = true }) catch return;
defer dir.close();

const step = b.step("examples", "Build all the examples");
var examples = dir.iterate();

while (examples.next() catch @panic("failed to get example file")) |example_file| {
std.debug.assert(example_file.kind == .file);

Expand Down

0 comments on commit 607c471

Please sign in to comment.