From 042f941c435364638486450695a1ba5edb25a408 Mon Sep 17 00:00:00 2001 From: Zachary Kupu Date: Thu, 3 Oct 2024 08:42:58 -0700 Subject: [PATCH] Due to some odd behavior with how powershell core (pwsh) (powershell 5.X not tested) interprets predefined gitlab CI variables (in this case CI_MERGE_REQUEST_DESCRIPTION) with a value that includes === The Contains method is used to ignore the string === to prevent pwsh from erroneously encountering an error. --- build_common.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build_common.ps1 b/build_common.ps1 index 6613a44ca..e85f7d503 100644 --- a/build_common.ps1 +++ b/build_common.ps1 @@ -56,8 +56,13 @@ If (Test-Path env:LIBPATH) { Push-Location "${vsPath}\VC\Auxiliary\Build" cmd /c "vcvarsall.bat x64&set" | ForEach-Object { + # Due to some odd behavior with how powershell core (pwsh) (powershell 5.X not tested) interprets a specific + # predefined gitlab CI variable (in this case CI_MERGE_REQUEST_DESCRIPTION) with a value that includes === + # The `Contains` method is used to ignore the string === to prevent pwsh from erroneously encountering an error. If ($_ -match "=") { - $v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])" + If (-not ($_.Contains('==='))) { + $v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])" + } } } Pop-Location