Skip to content

Commit 2983285

Browse files
Techatrixalexrp
authored andcommitted
zig fmt: flush stdout before exiting with error
1 parent 6a1d61d commit 2983285

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fmt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ pub fn run(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
195195
for (input_files.items) |file_path| {
196196
try fmtPath(&fmt, file_path, check_flag, fs.cwd(), file_path);
197197
}
198+
try fmt.stdout_writer.interface.flush();
198199
if (fmt.any_error) {
199200
process.exit(1);
200201
}
201-
try fmt.stdout_writer.interface.flush();
202202
}
203203

204204
fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool, dir: fs.Dir, sub_path: []const u8) !void {

0 commit comments

Comments
 (0)