File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,17 @@ fn build_examples(b: *Build, webui: *Compile) !void {
134134
135135 const examples_path = (if (zig_ver < 12 ) (Build.LazyPath { .path = "examples/C" }) else b .path ("examples/C" )).getPath (b );
136136 var examples_dir = if (zig_ver < 12 )
137- try std .fs .cwd ().openIterableDir (examples_path , .{})
137+ std .fs .cwd ().openIterableDir (examples_path , .{}) catch | e | switch (e ) {
138+ // Do not attempt building examples if directory does not exist.
139+ error .FileNotFound = > return ,
140+ else = > return e ,
141+ }
138142 else
139- try std .fs .cwd ().openDir (examples_path , .{ .iterate = true });
143+ std .fs .cwd ().openDir (examples_path , .{ .iterate = true }) catch | e | switch (e ) {
144+ // Do not attempt building examples if directory does not exist.
145+ error .FileNotFound = > return ,
146+ else = > return e ,
147+ };
140148 defer examples_dir .close ();
141149
142150 var paths = examples_dir .iterate ();
You can’t perform that action at this time.
0 commit comments