fix: keep hwpod job status in workspace

This commit is contained in:
root
2026-07-21 01:09:52 +02:00
parent 3369f1494c
commit 316338aa90
2 changed files with 1 additions and 13 deletions
+1 -1
View File
@@ -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 });
-12
View File
@@ -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] : [];
}