Skip to content

Commit

Permalink
stage2: make --color override apply to std.Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Dec 6, 2022
1 parent 55ca43a commit 3dcdd55
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,16 @@ pub fn update(comp: *Compilation) !void {
var progress: std.Progress = .{ .dont_print_on_dumb = true };
const main_progress_node = progress.start("", 0);
defer main_progress_node.end();
if (comp.color == .off) progress.terminal = null;
switch (comp.color) {
.off => {
progress.terminal = null;
},
.on => {
progress.terminal = std.io.getStdErr();
progress.supports_ansi_escape_codes = true;
},
.auto => {},
}

try comp.performAllTheWork(main_progress_node);

Expand Down

0 comments on commit 3dcdd55

Please sign in to comment.