Fix path-quoting in SessionStart check-config hook (handles spaces in CLAUDE_PLUGIN_ROOT)
If CLAUDE_PLUGIN_ROOT ever expands to a path containing whitespace
(e.g. ~/Library/Application Support/...), the unquoted ${CLAUDE_PLUGIN_ROOT}
in hooks/hooks.json word-splits and bash receives the path as multiple
arguments, failing with "No such file or directory" on the first split.
Quoting the expansion makes the invocation correct regardless of the
characters in the resolved path. Verified manually:
unquoted + space -> bash: /tmp/with: No such file or directory
quoted + space -> bash: /tmp/with spaces/.../check-config.sh: No such file
quoted + real -> /last30days: Ready - 7 sources active.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Trevin Chow
parent
7214dd6051
commit
5b0308b9e4
+1
-1
@@ -6,7 +6,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/check-config.sh",
|
||||
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/check-config.sh\"",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user