Skip to content

Commit a76bef5

Browse files
committed
fix(hooks): use versioned bunx to avoid cache issues
Add code-runner.ts wrapper that reads version from release-please manifest and runs bunx with exact version to prevent stale cache
1 parent f6fb62d commit a76bef5

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

hooks/hooks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"hooks": [
1818
{
1919
"type": "command",
20-
"command": "bunx @pleaseai/code format --stdin",
20+
"command": "bun $CLAUDE_PLUGIN_ROOT/hooks/scripts/code-runner.ts format --stdin",
2121
"timeout": 10
2222
},
2323
{
2424
"type": "command",
25-
"command": "bunx @pleaseai/code lsp --stdin",
25+
"command": "bun $CLAUDE_PLUGIN_ROOT/hooks/scripts/code-runner.ts lsp --stdin",
2626
"timeout": 10
2727
}
2828
]

hooks/scripts/code-runner.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { spawnSync } from 'node:child_process'
2+
import process from 'node:process'
3+
import manifest from '../../.release-please-manifest.json' with { type: 'json' }
4+
5+
const version = manifest['packages/code']
6+
const args = process.argv.slice(2)
7+
const result = spawnSync('bunx', [`@pleaseai/code@${version}`, ...args], {
8+
stdio: 'inherit',
9+
})
10+
process.exit(result.status ?? 1)

0 commit comments

Comments
 (0)