From a93430dd3f893a7642888bc16a67dcfe450d432c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=8D=9A=E6=96=87?= <1323515022@qq.com> Date: Fri, 30 Oct 2026 12:21:19 +0800 Subject: [PATCH] =?UTF-8?q?chore(tools):=202b=20=E6=B3=A8=E5=85=A5=20proof?= =?UTF-8?q?=20=E8=B7=AF=E5=BE=84=E9=9A=8F=E4=BB=93=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E6=8E=A8=E5=AF=BC=EF=BC=8C=E7=BC=BA=E5=A4=B1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8A=A5=E9=94=99=E6=96=87=E6=A1=88=E6=94=B9=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit proof 脚本原先硬编码 D 盘绝对路径,换机器就失效;仓库内已有同约定 (build-android.ps1 用 \ 推导),此处对齐。 text_check 的报错文案说「为空」,实际触发条件是 --units 缺失,改正。 --- tools/text_injection_proof.ps1 | 4 +++- viewer-core/examples/text_check.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/text_injection_proof.ps1 b/tools/text_injection_proof.ps1 index dc17ff6..5bc51df 100644 --- a/tools/text_injection_proof.ps1 +++ b/tools/text_injection_proof.ps1 @@ -21,7 +21,9 @@ # a stray injection would land in whatever window was foreground. $ErrorActionPreference = "Stop" -$repo = "D:\working\projects\yuankong\remote" +# Repo root derived from this script's location (tools/ is one level under the +# repo root) so the proof runs on any clone, not just the author's D: drive. +$repo = (Resolve-Path "$PSScriptRoot\..").Path $tmp = "$env:TEMP\remote-text-proof" $base = "D:\working\environment" diff --git a/viewer-core/examples/text_check.rs b/viewer-core/examples/text_check.rs index 10dfffb..ac35080 100644 --- a/viewer-core/examples/text_check.rs +++ b/viewer-core/examples/text_check.rs @@ -33,7 +33,10 @@ fn arg(name: &str) -> Option { fn parse_units(spec: &str) -> Result> { if spec.trim().is_empty() { - bail!("--units 为空:本轮要验证的是「有文本送出并被注入」,空输入没有验证价值"); + bail!( + "--units 缺失或为空:本工具要验证的是「有文本送出并被注入」,\ + 空输入没有验证价值(空 Text 在产品路径上由 Session::send_text 拦掉)" + ); } spec.split(',') .map(|s| s.trim())