Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from termcolor to anstream and anstyle #737

Merged
merged 20 commits into from
Apr 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clarify rustdoc child process color setting
  • Loading branch information
suaviloquence committed Apr 14, 2024
commit 00221481355f84091027270b53e7b16b4956803c
17 changes: 6 additions & 11 deletions src/rustdoc_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,12 @@ impl RustdocCommand {
cmd.arg("--no-deps");
}

// TODO
let color_choice = match anstream::stderr().current_choice() {
ColorChoice::Always | ColorChoice::AlwaysAnsi => "--color=always",
ColorChoice::Auto if anstream::stderr().is_terminal() => "--color=always",
ColorChoice::Auto | ColorChoice::Never => "--color=never",
};

cmd.arg(color_choice);
// if config.is_stderr_tty() {
// cmd.arg("--color=always");
// }
// since we write the stderr of the process to our stderr,
// our color preferences will be automatically applied when we write
// the process's stderr to our stderr, as long as we have color
// i.e., if we set no color output in `GlobalConfig`, when we write
// the child stderr to ours, its colors will be automatically stripped
cmd.arg("--color=always");

let output = cmd.output()?;
if !output.status.success() {
Expand Down
Loading