Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevCheck -CheckDependencies exitcode. Fix dependencies #4866

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fixed bug in issue counting math (issue found but fixed = 1 issue but…
… should be 0)
  • Loading branch information
DrusTheAxe committed Nov 13, 2024
commit d77e584d2a92c3104db880ff5cf04134462264e7
13 changes: 10 additions & 3 deletions tools/DevCheck/DevCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

$global:issues = 0
$global:issues_test_certificate_thumbprint_not_found = 0

$global:isadmin = $null

Expand All @@ -171,6 +172,11 @@ $global:vswhere_url = ''

$global:dependency_paths = ('dev', 'test', 'installer', 'tools')

function Get-Issues
{
return $global:issues + $global:issues_test_certificate_thumbprint_not_found
}

function Get-SettingsFile
{
if ([string]::IsNullOrEmpty($SettingsFile))
Expand Down Expand Up @@ -723,7 +729,7 @@ function Test-DevTestPfx
if (-not(Test-Path -Path $pfx_thumbprint -PathType Leaf))
{
Write-Host "Test certificate thumbprint $pfx_thumbprint...Not Found"
$global:issues++
$global:issues_test_certificate_thumbprint_not_found = 1
return $false
}

Expand Down Expand Up @@ -1706,14 +1712,15 @@ if (($RemoveAll -ne $false) -Or ($RemoveTestPfx -ne $false))
$null = Remove-DevTestPfx
}

if ($global:issues -eq 0)
$issues_count = Get-Issues
if ($issues_count -eq 0)
{
Write-Output "Coding time!"
Exit 0
}
else
{
$n = $global:issues
$n = $issues_count
Write-Output "$n issue(s) detected"
Exit 1
}
Loading