fix(hooks): avoid escaped quotes in plugin bootstrap

Generate the inline hook root resolver with single-quoted JavaScript literals so Windows Git Bash does not choke on nested escaped double quotes before Node starts. Refresh hooks.json and add regression coverage for parsed hook commands and installed hook manifests.
This commit is contained in:
Affaan Mustafa
2026-05-19 05:05:26 -04:00
committed by Affaan Mustafa
parent f93e8f6869
commit 6cb194a3c6
6 changed files with 74 additions and 24 deletions

View File

@@ -997,6 +997,13 @@ async function runTests() {
(Array.isArray(command) && typeof command[0] === 'string' && command[0].endsWith('.sh')) ||
commandText.endsWith('.sh');
if (isInline) {
assert.ok(
!commandText.includes('\\"'),
`Hook command in ${hookType} should not include escaped double quotes in node -e payload: ${commandText.substring(0, 80)}`
);
}
assert.ok(
isInline || isFilePath || isNpx || isShellWrapper || isShellScriptPath,
`Hook command in ${hookType} should be node -e, node script, npx, or shell wrapper/script, got: ${commandText.substring(0, 80)}`