fix(jenkins): escape powershell variables in bat wrapper

This commit is contained in:
2026-05-18 20:14:52 +08:00
parent 774b46b868
commit 4c10c181e3
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ if not exist "%GENARRATIVE_POWERSHELL%" (
echo [jenkins-powershell] user:
whoami
echo [jenkins-powershell] exe: %GENARRATIVE_POWERSHELL%
"%GENARRATIVE_POWERSHELL%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "$path = '%CD%\\${scriptPath}'; $text = [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8); $utf8Bom = New-Object System.Text.UTF8Encoding($true); [System.IO.File]::WriteAllText($path, $text, $utf8Bom)"
"%GENARRATIVE_POWERSHELL%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "\$path = '%CD%\\${scriptPath}'; \$text = [System.IO.File]::ReadAllText(\$path, [System.Text.Encoding]::UTF8); \$utf8Bom = New-Object System.Text.UTF8Encoding(\$true); [System.IO.File]::WriteAllText(\$path, \$text, \$utf8Bom)"
if errorlevel 1 exit /b %ERRORLEVEL%
"%GENARRATIVE_POWERSHELL%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%CD%\\${scriptPath}"
exit /b %ERRORLEVEL%