fix(jenkins): preserve powershell script encoding

This commit is contained in:
2026-05-18 20:06:15 +08:00
parent 269f35cecf
commit 774b46b868
3 changed files with 5 additions and 3 deletions

View File

@@ -12,6 +12,8 @@ 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)"
if errorlevel 1 exit /b %ERRORLEVEL%
"%GENARRATIVE_POWERSHELL%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%CD%\\${scriptPath}"
exit /b %ERRORLEVEL%
"""