From 194c2675614067e4106cf8c86bf7b6940331b428 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 9 Jun 2021 14:29:36 -0700 Subject: [PATCH] Log the ClangSharpPInvokeGeneratorPath and ensure the script doesn't fail for missing tools (#497) --- scripts/CommonUtils.ps1 | 8 ++++---- scripts/GenerateMetadataSource.ps1 | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/CommonUtils.ps1 b/scripts/CommonUtils.ps1 index a5a1a38a..064ebd8b 100644 --- a/scripts/CommonUtils.ps1 +++ b/scripts/CommonUtils.ps1 @@ -46,16 +46,16 @@ function Install-DotNetTool if ($Version -ne '') { - $installed = & dotnet tool list -g | select-string "$Name\s+$Version" - if (!$installed.Length) + $installed = & dotnet tool list -g | select-string -Pattern "$Name\s+$Version" -Raw + if (($installed -eq $null) -or !$installed.Length) { & dotnet tool update --global $Name --version $Version } } else { - $installed = & dotnet tool list -g | select-string "$Name" - if (!$installed.Length) + $installed = & dotnet tool list -g | select-string -Pattern "$Name" -Raw + if (($installed -eq $null) -or !$installed.Length) { & dotnet tool update --global $Name } diff --git a/scripts/GenerateMetadataSource.ps1 b/scripts/GenerateMetadataSource.ps1 index acff4de7..7cfb2794 100644 --- a/scripts/GenerateMetadataSource.ps1 +++ b/scripts/GenerateMetadataSource.ps1 @@ -42,6 +42,7 @@ $partitionNames = Get-ChildItem $partitionsDir | Select-Object -ExpandProperty N $stopwatch = [system.diagnostics.stopwatch]::StartNew() Write-Output "`nProcessing each partition...using $throttleCount parallel script(s)" +Write-Output "ClangSharpPInvokeGenerator resolved to $((Get-Command ClangSharpPInvokeGenerator).Path)" $errObj = new-object psobject Add-Member -InputObject $errObj -MemberType NoteProperty -Name ErrorCode -Value 0