diff --git a/.kilo/skills/jetbrains-cli-pin/SKILL.md b/.kilo/skills/jetbrains-cli-pin/SKILL.md index 2fc5b06ef5..f04217edec 100644 --- a/.kilo/skills/jetbrains-cli-pin/SKILL.md +++ b/.kilo/skills/jetbrains-cli-pin/SKILL.md @@ -64,7 +64,7 @@ the only reliable reset. In repo CLI mode, Gradle's `generateOpenApiSpec` task runs the local CLI source through `bun run --conditions=browser ./src/index.ts generate`. IDE-launched Gradle runs can have -worktree-local hint: +a stripped `PATH` where `bun` isn't resolvable. The `unpin`/`regen` commands write an ignored, worktree-local hint: ```text packages/kilo-jetbrains/.gradle/kilo-cli-pin.properties diff --git a/.kilo/skills/jetbrains-cli-pin/script/cli-pin.ts b/.kilo/skills/jetbrains-cli-pin/script/cli-pin.ts index a7223d3cba..a57676806d 100644 --- a/.kilo/skills/jetbrains-cli-pin/script/cli-pin.ts +++ b/.kilo/skills/jetbrains-cli-pin/script/cli-pin.ts @@ -53,14 +53,12 @@ async function setPinned(value: boolean) { await Bun.write(props, text.replace(/^kilo\.cli\.pinned=.*$/m, `kilo.cli.pinned=${value}`)) } -async function bunPath() { - const result = await $`command -v bun`.quiet().nothrow() - const bin = result.exitCode === 0 ? result.stdout.toString().trim() : "" - return bin || process.execPath +function bunPath() { + return Bun.which("bun") ?? process.execPath } async function writeBunHint() { - const path = await bunPath() + const path = bunPath() await $`mkdir -p ${jb}/.gradle` await Bun.write(hint, `# Generated by jetbrains-cli-pin so IDE-launched Gradle can find Bun in repo CLI mode.\nbun.path=${path}\n`) console.log(`Wrote Bun path hint for repo CLI mode: ${path}`)