authorgravatar for kjs@scheibo.comKirk Scheibelhut <kjs@scheibo.com> 2022-05-12 12:05:07-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-13 16:45:00-04:00
log24633b561369b5847e33d54ac02b77f23c9f8519
tree8b48b2ca654cbff7a13e5790d28bd2ef07bc7ccb
parentfb0692334ed64a995690c21525fc3e729e63f424

zig fmt: make --exclude ignore missing dirs


1 files changed, 4 insertions(+), 1 deletions(-)

src/main.zig+4-1
...@@ -3960,7 +3960,10 @@ pub fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void...@@ -3960,7 +3960,10 @@ pub fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void
3960 // Mark any excluded files/directories as already seen,3960 // Mark any excluded files/directories as already seen,
3961 // so that they are skipped later during actual processing3961 // so that they are skipped later during actual processing
3962 for (excluded_files.items) |file_path| {3962 for (excluded_files.items) |file_path| {
3963 var dir = try fs.cwd().openDir(file_path, .{});3963 var dir = fs.cwd().openDir(file_path, .{}) catch |err| switch (err) {
3964 error.FileNotFound => continue,
3965 else => |e| return e,
3966 };
3964 defer dir.close();3967 defer dir.close();
39653968
3966 const stat = try dir.stat();3969 const stat = try dir.stat();