From 64ec1f5b0266f82d56b0cd64eafa3575cf33db2a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 31 Oct 2021 08:42:30 -0400 Subject: [PATCH] ci(win): only remove choco's cpack.exe if it exists (cherry picked from commit ec0f4fab486434b5dd6ab9c7fb402cc8c1f73c98) --- ci/build.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/build.ps1 b/ci/build.ps1 index a2d7d4fcdc..745d7e99f5 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -171,7 +171,9 @@ if (-not $NoTests) { } # Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's -Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force +if (Get-Item -Path $env:ChocolateyInstall\bin\cpack.exe) { + Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force +} # Build artifacts cpack -G ZIP -C RelWithDebInfo