fix(opencode): resolve ripgrep worker path in builds (#22436)

This commit is contained in:
Shoubhit Dash
2026-04-14 16:39:21 +05:30
committed by GitHub
parent 7cbe1627ec
commit 5b60e51c9f
2 changed files with 15 additions and 2 deletions

View File

@@ -268,7 +268,12 @@ export namespace Ripgrep {
.flatMap((item) => (item.type === "match" ? [row(item.data)] : []))
}
function target() {
declare const OPENCODE_RIPGREP_WORKER_PATH: string
function target(): Effect.Effect<string | URL, Error> {
if (typeof OPENCODE_RIPGREP_WORKER_PATH !== "undefined") {
return Effect.succeed(OPENCODE_RIPGREP_WORKER_PATH)
}
const js = new URL("./ripgrep.worker.js", import.meta.url)
return Effect.tryPromise({
try: () => Filesystem.exists(fileURLToPath(js)),