mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 10:16:37 +00:00
fix(opencode): resolve ripgrep worker path in builds (#22436)
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user