diff options
author | 2023-04-15 02:41:32 -0700 | |
---|---|---|
committer | 2023-04-15 02:41:32 -0700 | |
commit | d4436f278c1933effb13c2040811e261db7af297 (patch) | |
tree | 315203d5f8b718bca1450ada3198453551cc244d | |
parent | 530f5ef82cfe5620a3cc5ce71c4a0fabe16b6593 (diff) | |
download | bun-d4436f278c1933effb13c2040811e261db7af297.tar.gz bun-d4436f278c1933effb13c2040811e261db7af297.tar.zst bun-d4436f278c1933effb13c2040811e261db7af297.zip |
Fix failing to log error with `--transform`
-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; } |