loop-task 2.0.9 → 2.0.11

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.
@@ -7,7 +7,7 @@ function quoteArg(arg) {
7
7
  return /[\s"]/.test(arg) ? `"${arg.replace(/"/g, '\\"')}"` : arg;
8
8
  }
9
9
  function formatCommandLine(command, commandArgs) {
10
- return [command, ...commandArgs.map((a) => quoteArg(a.replace(/\n/g, " ").replace(/\r/g, " ")))].join(" ").trim();
10
+ return [command, ...commandArgs.map((a) => quoteArg(a.replace(/[\n\r]/g, " ")))].join(" ").trim();
11
11
  }
12
12
  export function extractExitCode(error) {
13
13
  return error && typeof error === "object" && "exitCode" in error
@@ -21,6 +21,9 @@ export async function executeCommand(command, commandArgs, cwd, logStream, signa
21
21
  logStream.write(header);
22
22
  }
23
23
  logStream.write(t("loop.commandLine", { command: formatCommandLine(command, commandArgs) }));
24
+ if (cwd) {
25
+ logStream.write(t("loop.cwdLine", { cwd }));
26
+ }
24
27
  if (cwd && !fs.existsSync(cwd)) {
25
28
  const endedAt = new Date();
26
29
  logStream.write(t("loop.cwdMissingLog", { cwd }));
@@ -35,6 +38,7 @@ export async function executeCommand(command, commandArgs, cwd, logStream, signa
35
38
  cwd: cwd || undefined,
36
39
  cancelSignal: signal,
37
40
  shell: true,
41
+ env: process.env,
38
42
  });
39
43
  const stdoutChunks = [];
40
44
  let stdoutTruncated = false;
package/dist/i18n/en.json CHANGED
@@ -66,6 +66,7 @@
66
66
  "cli.projectInvalidColor": "Invalid color \"{color}\". Valid names: {valid}, or a #rrggbb hex",
67
67
  "loop.runHeader": "\n[Run #{runNumber} - {timestamp}]\n",
68
68
  "loop.commandLine": "$ {command}\n",
69
+ "loop.cwdLine": " cwd: {cwd}\n",
69
70
  "loop.chainHeader": "\n--- Chain: {name} ({branch}, prev exit {prevExit}) ---\n",
70
71
  "loop.exitMarker": "[exit {code} · {duration}]\n",
71
72
  "loop.cwdMissingLog": "[error] working directory does not exist: {cwd}\n",
@@ -12,6 +12,8 @@ function colorForLine(line, run) {
12
12
  return theme.accent.loop;
13
13
  if (line.startsWith("$ "))
14
14
  return "#f0abfc";
15
+ if (line.startsWith(" cwd:"))
16
+ return theme.text.muted;
15
17
  if (line.includes("--- Chain:"))
16
18
  return theme.accent.task;
17
19
  if (line.trimStart().startsWith("[exit")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loop-task",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
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": {