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:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user