Fixes #7352 - ignore zig fmt ignore zig-cache

This commit is contained in:
Lee Cannon
2020-12-09 07:45:54 +00:00
committed by Andrew Kelley
parent 85c1db9222
commit a7eea0813f

View File

@@ -2622,6 +2622,9 @@ fn fmtPathDir(
var dir_it = dir.iterate();
while (try dir_it.next()) |entry| {
const is_dir = entry.kind == .Directory;
if (is_dir and std.mem.eql(u8, entry.name, "zig-cache")) continue;
if (is_dir or mem.endsWith(u8, entry.name, ".zig")) {
const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });
defer fmt.gpa.free(full_path);