loop-task 2.1.3 → 2.1.4

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.
@@ -5,21 +5,14 @@ import { t } from "../i18n/index.js";
5
5
  import { MAX_CONTEXT_STDOUT_BYTES } from "../config/constants.js";
6
6
  function quoteArg(arg) {
7
7
  if (arg.length === 0)
8
- return '""';
9
- // If the arg already starts with a single quote (from interpolate's
10
- // shellEscape), it's already safely shell-quoted — pass through as-is.
11
- if (arg.startsWith("'") && arg.endsWith("'"))
12
- return arg;
13
- // Safe characters: no quoting needed
8
+ return "''";
14
9
  if (/^[A-Za-z0-9_\-=:./,@]+$/.test(arg))
15
10
  return arg;
16
- // Otherwise: double-quote and escape inner double-quotes.
17
- // Replace newlines with spaces (shell command line is single-line).
18
11
  const cleaned = arg.replace(/[\n\r]/g, " ");
19
- return `"${cleaned.replace(/"/g, '\\"')}"`;
12
+ return "'" + cleaned.replace(/'/g, "'\\''") + "'";
20
13
  }
21
14
  function formatCommandLine(command, commandArgs) {
22
- return [command, ...commandArgs.map((a) => quoteArg(a.replace(/[\n\r]/g, " ")))].join(" ").trim();
15
+ return [command, ...commandArgs.map(quoteArg)].join(" ").trim();
23
16
  }
24
17
  export function extractExitCode(error) {
25
18
  return error && typeof error === "object" && "exitCode" in error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loop-task",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
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": {