mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
fix(claude-hook): use forward slashes in Windows managed hook command path (#1329)
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
co-authored by
Amp
parent
0e06d2e9b5
commit
6faf406511
@@ -48,7 +48,15 @@ function getManagedScriptPath(): string {
|
||||
}
|
||||
|
||||
function getManagedCommand(scriptPath: string): string {
|
||||
return process.platform === 'win32' ? scriptPath : `/bin/sh "${scriptPath}"`
|
||||
// Why: on Windows, Claude Code runs hooks through Git Bash (`/usr/bin/bash`).
|
||||
// A path with single backslashes (e.g. `C:\Users\…\claude-hook.cmd`) is
|
||||
// interpreted by bash as a string with escape sequences, so `\U`, `\A`, etc.
|
||||
// collapse and the launcher fails with `command not found`. Emit forward
|
||||
// slashes — Windows accepts them in path arguments and bash leaves them
|
||||
// intact, so the same JSON value works through every shell layer.
|
||||
return process.platform === 'win32'
|
||||
? scriptPath.replaceAll('\\', '/')
|
||||
: `/bin/sh "${scriptPath}"`
|
||||
}
|
||||
|
||||
function getManagedScript(): string {
|
||||
|
||||
Reference in New Issue
Block a user