diff options
-rw-r--r-- | src/cli/build_command.zig | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cli/build_command.zig b/src/cli/build_command.zig index 825ab4d2a..51e98f9d0 100644 --- a/src/cli/build_command.zig +++ b/src/cli/build_command.zig @@ -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; } |