summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/file/ripgrep.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts
index d023f47c3..f575154e0 100644
--- a/packages/opencode/src/file/ripgrep.ts
+++ b/packages/opencode/src/file/ripgrep.ts
@@ -211,6 +211,16 @@ export namespace Ripgrep {
}
}
+ // Bun.spawn should throw this, but it incorrectly reports that the executable does not exist.
+ // See https://github.com/oven-sh/bun/issues/24012
+ if (!(await fs.stat(input.cwd).catch(() => undefined))?.isDirectory()) {
+ throw Object.assign(new Error(`No such file or directory: '${input.cwd}'`), {
+ code: "ENOENT",
+ errno: -2,
+ path: input.cwd,
+ });
+ }
+
const proc = Bun.spawn(args, {
cwd: input.cwd,
stdout: "pipe",