From 73dfc29ec04dfc282ef710ad31623ee5d4e98dea Mon Sep 17 00:00:00 2001 From: Abhipsa Misra Date: Fri, 14 Aug 2020 21:54:46 -0700 Subject: [PATCH] fix(vsts): Fix expression for evaluating local package availabilityfor testing --- build.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index bc01e24c34..4553ff6b11 100644 --- a/build.ps1 +++ b/build.ps1 @@ -99,7 +99,7 @@ Function CheckTools($commands) Function CheckLocalPackagesAvailableForTesting() { - $localPackagesAvailableForTesting = (-not [string]::IsNullOrWhiteSpace($env:AZURE_IOT_LOCALPACKAGES)) + return (-not [string]::IsNullOrWhiteSpace($env:AZURE_IOT_LOCALPACKAGES)) } Function BuildProject($path, $message) @@ -216,13 +216,14 @@ $localPackages = Join-Path $rootDir "bin\pkg" $startTime = Get-Date $buildFailed = $true $errorMessage = "" -$localPackagesAvailableForTesting = $false +$localPackagesAvailableForTesting = CheckLocalPackagesAvailableForTesting + +Write-Host -ForegroundColor Magenta "Local packages being used for testing: $localPackagesAvailableForTesting" try { if ($sign) { - CheckLocalPackagesAvailableForTesting if ($localPackagesAvailableForTesting) { throw "Local NuGet package source path is not set, required when signing packages."