Skip to content

Commit 9430cfc

Browse files
only21milclaude
andcommitted
refactor(shared): keep the shim-escaping comment to three lines
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ee64244 commit 9430cfc

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎packages/shared/src/shell.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,9 @@ function escapeWindowsShellArg(arg: string): string {
6262
return escaped.replace(WINDOWS_SHELL_META_CHARS, "^$1");
6363
}
6464

65-
/**
66-
* A `.cmd`/`.bat` shim forwards its arguments with `%*`, so cmd.exe parses them
67-
* again once the first caret layer is gone. A quote in the argument ends the
68-
* quoting that keeps `&` or `|` literal there, so it gets a second layer, as in
69-
* cross-spawn. Other arguments stay quoted through both parses and keep one.
70-
*/
65+
// A `.cmd`/`.bat` shim's `%*` makes cmd.exe parse the arguments again without the
66+
// first caret layer. A quote there exposes `&` or `|`, so such arguments get
67+
// cross-spawn's second layer; quote-free ones stay quoted through both parses.
7168
function escapeWindowsShimArg(arg: string): string {
7269
const escaped = escapeWindowsShellArg(arg);
7370
return arg.includes('"') ? escaped.replace(WINDOWS_SHELL_META_CHARS, "^$1") : escaped;

0 commit comments

Comments
 (0)