Fixes dotnet if dotnet tool is not available (#229)

* Fixes dotnet if dotnet tool si not available

* dotnet: multi-lang support

* Fixes dotnet for non-english terminals
This commit is contained in:
Thomas Schönauer
2022-12-18 14:12:36 +00:00
committed by GitHub
parent ee353ccb66
commit 56a717dcc6

View File

@@ -488,6 +488,9 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> {
pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> {
let dotnet = utils::require("dotnet")?;
let dotnet_help_output = ctx.run_type().execute(&dotnet).arg("-h").output().err().unwrap();
if dotnet_help_output.to_string().contains("tool") {
let output = Command::new(dotnet)
.args(["tool", "list", "--global"])
.output_checked_utf8()?;
@@ -512,7 +515,7 @@ pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> {
.status_checked()
.with_context(|| format!("Failed to update .NET package {package_name}"))?;
}
}
Ok(())
}