From 316338aa90227fc5b9c768f85dcbf4bec5d67b37 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Jul 2026 01:09:52 +0200 Subject: [PATCH] fix: keep hwpod job status in workspace --- tools/hwpod-harness.test.ts | 2 +- tools/src/hwpod-harness-lib.ts | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/tools/hwpod-harness.test.ts b/tools/hwpod-harness.test.ts index 0ec50891..2d40e6b5 100644 --- a/tools/hwpod-harness.test.ts +++ b/tools/hwpod-harness.test.ts @@ -175,7 +175,7 @@ test("hwpod-compiler-cli generates Keil build and download commands from structu assert.equal(jobStatus.payload.plan.ops[0].args.step, "keil-job-status"); assert.deepEqual(jobStatus.payload.plan.ops[0].args.argv.slice(0, 3), ["-3", "C:\\Users\\liang\\.agents\\skills\\keil\\keil-cli.py", "job-status"]); assert.equal(jobStatus.payload.plan.ops[0].args.argv[3], "keil_job_123"); - assert.equal(jobStatus.payload.plan.ops[0].args.workspacePath, "C:\\Users\\liang\\.agents\\skills\\keil"); + assert.equal(jobStatus.payload.plan.ops[0].args.workspacePath, "F:\\Work\\D601-HWLAB"); await runHwpodCtl(["spec", "set", "spec.debugProbe.downloadCommand", "custom download command", "--spec", specPath], { now: () => NOW }); const override = await runHwpodCompilerCli(["compile", "--spec", specPath, "--intent", "debug.download"], { now: () => NOW }); diff --git a/tools/src/hwpod-harness-lib.ts b/tools/src/hwpod-harness-lib.ts index 337408d8..829c4ede 100644 --- a/tools/src/hwpod-harness-lib.ts +++ b/tools/src/hwpod-harness-lib.ts @@ -793,7 +793,6 @@ function debugJobStatusOps(common: any, args: any, document: any) { op: "cmd.run", args: clean({ ...common, - workspacePath: dirnameForCommandPath(generated.keilCliPath), command: generated.commandRun.command, argv: generated.commandRun.argv, commandLine: generated.command, @@ -1002,17 +1001,6 @@ function isAbsoluteLikePath(value: string) { return /^[A-Za-z]:[\\/]/u.test(value) || value.startsWith("/") || value.startsWith("\\\\"); } -function dirnameForCommandPath(candidate: string) { - const value = text(candidate); - if (!value) return "."; - if (/^[A-Za-z]:[\\/]/u.test(value) || value.includes("\\")) { - const normalized = value.replace(/[\\/]+$/u, ""); - const parent = normalized.replace(/[\\/][^\\/]*$/u, ""); - return parent && parent !== normalized ? parent : "."; - } - return path.dirname(value); -} - function targetOption(target: string) { return target ? ["-t", target] : []; }