From 3957ff023f911f8a62cc7eb32ff4aeb53ea32233 Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Fri, 23 Dec 2022 13:09:27 +1000 Subject: [PATCH] fix conditions --- .azure/pipelines/azure-pipelines-clean-agent.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure/pipelines/azure-pipelines-clean-agent.yml b/.azure/pipelines/azure-pipelines-clean-agent.yml index b52f9904..38869d11 100644 --- a/.azure/pipelines/azure-pipelines-clean-agent.yml +++ b/.azure/pipelines/azure-pipelines-clean-agent.yml @@ -32,22 +32,22 @@ steps: [bool]$CleanSourcesFolder = ${{parameters.CleanSourcesFolder}} [bool]$CleanPublishFolder = ${{parameters.CleanPublishFolder}} - if ($CleanArtifactsFolder -and Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) { + if ($CleanArtifactsFolder -and (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_ARTIFACTSTAGINGDIRECTORY" Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanBinariesFolder -and Test-Path $env:BUILD_BINARIESDIRECTORY) { + if ($CleanBinariesFolder -and (Test-Path $env:BUILD_BINARIESDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_BINARIESDIRECTORY" Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanSourcesFolder -and Test-Path $env:BUILD_SOURCESDIRECTORY) { + if ($CleanSourcesFolder -and (Test-Path $env:BUILD_SOURCESDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_SOURCESDIRECTORY" Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanPublishFolder -and Test-Path $env:BUILD_PUBLISHDIRECTORY) { + if ($CleanPublishFolder -and (Test-Path $env:BUILD_PUBLISHDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_PUBLISHDIRECTORY" Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue }