mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-11 02:33:10 +08:00
`extractCommandSubstitutions` only walks `$(...)` and backticks — the two shell constructs whose bodies are captured as strings. Bash also has plain `(...)` subshells (e.g. `(npm run dev)`), where the body executes in a child shell but is not value-captured. Our PreToolUse hooks need to peer inside those too, because a `(...)` group bypasses the top-level segment splitter just like `$(...)` does. This commit adds a sibling extractor with the same conventions as `extractCommandSubstitutions`: - single quotes literal — `'(npm run dev)'` is a string, ignored - double quotes literal for parens — `"(npm run dev)"` is a string (bash only honors `$(...)`, not bare `(...)`, inside double quotes) - skips `$(...)` and backtick spans so we don't double-extract bodies the other helper already handles - recurses into its own bodies for nested groups No consumer yet; the next commit wires both extractors into `scripts/hooks/pre-bash-dev-server-block.js` to close the subshell bypass surface.
5.2 KiB
5.2 KiB