fix: better dotnet tool list header parsing (#772)

fix: better dotnet tool list header parsing
This commit is contained in:
Andre Toerien
2024-04-14 03:10:08 +02:00
committed by GitHub
parent 04bfb45a97
commit ecf8fb7a47

View File

@@ -773,6 +773,7 @@ pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> {
} }
}; };
let mut in_header = true;
let mut packages = output let mut packages = output
.stdout .stdout
.lines() .lines()
@@ -780,11 +781,17 @@ pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> {
// //
// Package Id Version Commands // Package Id Version Commands
// ------------------------------------- // -------------------------------------
// .skip_while(|line| {
// One thing to note is that .NET SDK respect locale, which means this // The .NET SDK respects locale, so the header can be printed
// header can be printed in languages other than English, do NOT use it // in languages other than English. The separator should hopefully
// to do any check. // always be at least 10 -'s long.
.skip(2) if in_header && line.starts_with("----------") {
in_header = false;
true
} else {
in_header
}
})
.filter(|line| !line.is_empty()) .filter(|line| !line.is_empty())
.peekable(); .peekable();