refactor: 移除 success 字段,简化为 matched 单层判定模型
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user