Commit 4b89979
Fix script corruption in executeJxa shell-escape
executeJxa built the osascript command as a shell string and escaped
single quotes with `'` -> `''`. That is not a valid bash escape inside
a single-quoted string; `''` collapses to nothing, so every apostrophe
in the JXA script was silently stripped before reaching osascript.
The bug is latent today because the project's JXA strings use double
quotes throughout, but any tool emitting a single-quoted JXA string
literal (an `'foo'`, an apostrophe in a thrown error message, etc.)
would produce a syntax error or, worse, a silently malformed script.
Switch to execFile with an argv array. osascript receives the script
as a single argument, no shell interpretation, no escaping needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 03fba2d commit 4b89979
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
0 commit comments