mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Omit colors when writing to output file (#186)
We were writing color escape codes to the file specified by `-o`.
This commit is contained in:
parent
61a61db154
commit
9f894213e0
1 changed files with 8 additions and 0 deletions
|
@ -126,6 +126,10 @@ pub(crate) async fn pip_compile(
|
|||
.dimmed()
|
||||
)?;
|
||||
|
||||
if output_file.is_some() {
|
||||
colored::control::set_override(false);
|
||||
}
|
||||
|
||||
let mut writer: Box<dyn std::io::Write> = if let Some(output_file) = output_file {
|
||||
Box::new(BufWriter::new(File::create(output_file)?))
|
||||
} else {
|
||||
|
@ -145,5 +149,9 @@ pub(crate) async fn pip_compile(
|
|||
)?;
|
||||
write!(writer, "{resolution}")?;
|
||||
|
||||
if output_file.is_some() {
|
||||
colored::control::unset_override();
|
||||
}
|
||||
|
||||
Ok(ExitStatus::Success)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue