diff --git a/.gitattributes b/.gitattributes index d5b4bd85..547bbc40 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ project-docs/legal-policy-candidates/**/*.md text eol=lf project-docs/legal-policy-candidates/**/*.json text eol=lf +*.cmd text eol=crlf diff --git a/yuqei-infra/scripts/Approve-ReleaseCandidate.cmd b/yuqei-infra/scripts/Approve-ReleaseCandidate.cmd index 021be4aa..2568f2b6 100644 --- a/yuqei-infra/scripts/Approve-ReleaseCandidate.cmd +++ b/yuqei-infra/scripts/Approve-ReleaseCandidate.cmd @@ -4,14 +4,14 @@ chcp 65001 >nul set "launcher=%~dp0Launch-ReleaseSigner.ps1" set "powershell=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" if not exist "%powershell%" ( - echo 启动失败:系统缺少受信任的 Windows PowerShell。 - echo 未创建候选批准,请将此窗口截图交给系统处理。 + echo Signer startup failed: Windows PowerShell was not found. + echo No candidate approval was created. Send this window to system support. pause exit /b 2 ) "%powershell%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%launcher%" sign set "result=%ERRORLEVEL%" echo. -if not "%result%"=="0" echo 签署未完成,未创建新的候选批准。 +if not "%result%"=="0" echo Signing did not complete. No new candidate approval was created. pause exit /b %result% diff --git a/yuqei-infra/scripts/Initialize-ReleaseSigner.cmd b/yuqei-infra/scripts/Initialize-ReleaseSigner.cmd index 731fdff6..f6429fcd 100644 --- a/yuqei-infra/scripts/Initialize-ReleaseSigner.cmd +++ b/yuqei-infra/scripts/Initialize-ReleaseSigner.cmd @@ -4,14 +4,14 @@ chcp 65001 >nul set "launcher=%~dp0Launch-ReleaseSigner.ps1" set "powershell=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" if not exist "%powershell%" ( - echo 启动失败:系统缺少受信任的 Windows PowerShell。 - echo 未创建审核密钥,请将此窗口截图交给系统处理。 + echo Signer startup failed: Windows PowerShell was not found. + echo No reviewer key was created. Send this window to system support. pause exit /b 2 ) "%powershell%" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%launcher%" initialize set "result=%ERRORLEVEL%" echo. -if not "%result%"=="0" echo 初始化未完成,未创建审核密钥或候选批准。 +if not "%result%"=="0" echo Initialization did not complete. No reviewer key or candidate approval was created. pause exit /b %result% diff --git a/yuqei-infra/tests/test_rc06_publication_batch.py b/yuqei-infra/tests/test_rc06_publication_batch.py index 5824df28..dbe7894f 100644 --- a/yuqei-infra/tests/test_rc06_publication_batch.py +++ b/yuqei-infra/tests/test_rc06_publication_batch.py @@ -1797,7 +1797,11 @@ def test_windows_launcher_uses_isolated_runtime_and_ignores_pythonpath( assert json.loads(completed.stdout.splitlines()[-1])["status"] == "isolated_runtime_verified" assert not marker.exists() for name in ("Initialize-ReleaseSigner.cmd", "Approve-ReleaseCandidate.cmd"): - raw = SIGNER_SCRIPT.with_name(name).read_text(encoding="utf-8") + raw_bytes = SIGNER_SCRIPT.with_name(name).read_bytes() + raw = raw_bytes.decode("ascii") + assert b"\r\n" in raw_bytes + assert b"\n" not in raw_bytes.replace(b"\r\n", b"") + assert "chcp 65001 >nul\r\n" in raw assert "Launch-ReleaseSigner.ps1" in raw assert "where python" not in raw.casefold()