mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 20:13:21 +00:00
zig fmt: make --exclude ignore missing dirs
This commit is contained in:
parent
fb0692334e
commit
24633b5613
@ -3960,7 +3960,10 @@ pub fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void
|
||||
// Mark any excluded files/directories as already seen,
|
||||
// so that they are skipped later during actual processing
|
||||
for (excluded_files.items) |file_path| {
|
||||
var dir = try fs.cwd().openDir(file_path, .{});
|
||||
var dir = fs.cwd().openDir(file_path, .{}) catch |err| switch (err) {
|
||||
error.FileNotFound => continue,
|
||||
else => |e| return e,
|
||||
};
|
||||
defer dir.close();
|
||||
|
||||
const stat = try dir.stat();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user