Fix failing to log error with --transform

This commit is contained in:
Jarred Sumner
2023-04-15 02:41:32 -07:00
parent 530f5ef82c
commit d4436f278c

View File

@@ -101,8 +101,17 @@ pub const BuildCommand = struct {
ctx.log,
ctx.args,
);
try log.msgs.appendSlice(result.errors);
try log.msgs.appendSlice(result.warnings);
if (log.msgs.items.len > 0) {
try log.printForLogLevel(Output.errorWriter());
if (result.errors.len > 0 or result.output_files.len == 0) {
Output.flush();
exitOrWatch(1, ctx.debug.hot_reload == .watch);
unreachable;
}
}
break :brk result.output_files;
}