summaryrefslogtreecommitdiffhomepage
path: root/script
diff options
context:
space:
mode:
authorKhang Ha (Kelvin) <[email protected]>2026-02-07 05:16:56 +0700
committerGitHub <[email protected]>2026-02-06 16:16:56 -0600
commitfde0b39b7c97dacb78cb55f3d963aa54f61650ea (patch)
tree066ebb3f0a2716c9e0ee8e72b55239ad249cd5d1 /script
parente9a3cfc083bf480ba2c8aaa585a4e914549e3e56 (diff)
downloadopencode-fde0b39b7c97dacb78cb55f3d963aa54f61650ea.tar.gz
opencode-fde0b39b7c97dacb78cb55f3d963aa54f61650ea.zip
fix: properly encode file URLs with special characters (#12424)
Diffstat (limited to 'script')
-rwxr-xr-xscript/duplicate-pr.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/duplicate-pr.ts b/script/duplicate-pr.ts
index aba078cec..b77737c1d 100755
--- a/script/duplicate-pr.ts
+++ b/script/duplicate-pr.ts
@@ -1,6 +1,7 @@
#!/usr/bin/env bun
import path from "path"
+import { pathToFileURL } from "bun"
import { createOpencode } from "@opencode-ai/sdk"
import { parseArgs } from "util"
@@ -49,7 +50,7 @@ Examples:
}
parts.push({
type: "file",
- url: `file://${resolved}`,
+ url: pathToFileURL(resolved).href,
filename: path.basename(resolved),
mime: "text/plain",
})