1
0

refactor: 移除 success 字段,简化为 matched 单层判定模型

This commit is contained in:
2026-05-11 13:12:55 +08:00
parent 548b44d28e
commit 35ba56888b
93 changed files with 3893 additions and 103 deletions

View File

@@ -61,6 +61,7 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
proc = Bun.spawn([target.command.exec, ...target.command.args], {
cwd: target.command.cwd,
env: target.command.env,
stdin: "ignore",
stdout: "pipe",
stderr: "pipe",
});
@@ -69,7 +70,6 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
return {
targetName: target.name,
timestamp,
success: false,
matched: false,
durationMs,
statusDetail: null,
@@ -102,7 +102,6 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
return {
targetName: target.name,
timestamp,
success: false,
matched: false,
durationMs,
statusDetail: null,
@@ -120,7 +119,6 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
return {
targetName: target.name,
timestamp,
success: false,
matched: false,
durationMs,
statusDetail: `exitCode=${exitCode}`,
@@ -132,7 +130,6 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
return {
targetName: target.name,
timestamp,
success: false,
matched: false,
durationMs,
statusDetail: null,
@@ -146,7 +143,6 @@ export async function runCommandCheck(target: ResolvedCommandTarget): Promise<Ch
return {
targetName: target.name,
timestamp,
success: expectResult.matched,
matched: expectResult.matched,
durationMs,
statusDetail: `exitCode=${exitCode}`,