summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2026-02-21 10:40:30 -0800
committerJesse Vincent <jesse@fsck.com>2026-02-21 10:40:30 -0800
commit31bbbe2dbb6ea718c410f1d858c7fdffb12ea678 (patch)
treee49b0d2d32da44dcf55555093060f0b0f1e61aa8 /hooks
parent5fbefbd0a96074f871ec465f0c54f913c1e4919f (diff)
fix: quote CLAUDE_PLUGIN_ROOT for spaces, use POSIX-safe path resolution
- Quote ${CLAUDE_PLUGIN_ROOT} in hooks.json to handle paths with spaces (e.g. "C:\Users\Robert Zimmermann\...") - Replace bash-only ${BASH_SOURCE[0]:-$0} with POSIX-safe $0 in run-hook.cmd so the Unix path doesn't break on dash (/bin/sh) Addresses: #518 (spaces in path), Ubuntu/Debian compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'hooks')
-rw-r--r--hooks/hooks.json2
-rwxr-xr-xhooks/run-hook.cmd2
2 files changed, 2 insertions, 2 deletions
diff --git a/hooks/hooks.json b/hooks/hooks.json
index 5679ac5..2dacc8a 100644
--- a/hooks/hooks.json
+++ b/hooks/hooks.json
@@ -6,7 +6,7 @@
"hooks": [
{
"type": "command",
- "command": "${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd session-start",
+ "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start",
"async": false
}
]
diff --git a/hooks/run-hook.cmd b/hooks/run-hook.cmd
index f65134d..ceec3a7 100755
--- a/hooks/run-hook.cmd
+++ b/hooks/run-hook.cmd
@@ -40,7 +40,7 @@ exit /b 0
CMDBLOCK
# Unix: run the named script directly
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_NAME="$1"
shift
exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"