loop-task 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,10 +14,12 @@ export function extractExitCode(error) {
|
|
|
14
14
|
? error.exitCode
|
|
15
15
|
: 1;
|
|
16
16
|
}
|
|
17
|
-
export async function executeCommand(command, commandArgs, cwd, logStream, signal, runNumber, captureStdout = false) {
|
|
17
|
+
export async function executeCommand(command, commandArgs, cwd, logStream, signal, runNumber, captureStdout = false, isChain = false) {
|
|
18
18
|
const startedAt = new Date();
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (!isChain) {
|
|
20
|
+
const header = t("loop.runHeader", { timestamp: startedAt.toLocaleString(), runNumber: runNumber ?? 0 });
|
|
21
|
+
logStream.write(header);
|
|
22
|
+
}
|
|
21
23
|
logStream.write(t("loop.commandLine", { command: formatCommandLine(command, commandArgs) }));
|
|
22
24
|
if (cwd && !fs.existsSync(cwd)) {
|
|
23
25
|
const endedAt = new Date();
|
|
@@ -371,7 +371,6 @@ export class LoopController extends EventEmitter {
|
|
|
371
371
|
break;
|
|
372
372
|
if (this.logStream) {
|
|
373
373
|
this.logStream.write(t("loop.chainHeader", { name: chainTask.name, branch: prevBranch, prevExit }));
|
|
374
|
-
this.logStream.write(t("loop.commandLine", { command: [chainTask.command, ...chainTask.commandArgs.map((a) => /[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a).map((a) => a.replace(/\n/g, " ").replace(/\r/g, " "))].join(" ").trim() }));
|
|
375
374
|
}
|
|
376
375
|
const chainStartedAt = new Date().toISOString();
|
|
377
376
|
const chainOffset = fs.existsSync(this.logPath) ? fs.statSync(this.logPath).size : 0;
|
|
@@ -388,7 +387,7 @@ export class LoopController extends EventEmitter {
|
|
|
388
387
|
});
|
|
389
388
|
const interpolatedCommand = interpolate(chainTask.command, chainContext);
|
|
390
389
|
const interpolatedArgs = chainTask.commandArgs.map(a => interpolate(a, chainContext));
|
|
391
|
-
const chainResult = await executeCommand(interpolatedCommand, interpolatedArgs, this.options.cwd, this.logStream, signal, this.runCount, true);
|
|
390
|
+
const chainResult = await executeCommand(interpolatedCommand, interpolatedArgs, this.options.cwd, this.logStream, signal, this.runCount, true, true);
|
|
392
391
|
if (chainResult.stdout) {
|
|
393
392
|
const parsed = parseStdout(chainResult.stdout);
|
|
394
393
|
if (parsed !== null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loop-task",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Loop engineering toolkit. Run any command on a cadence, in the background, managed from a terminal board. Schedule tests, builds, syncs, or agent prompts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|