mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-11 13:21:03 +00:00
fix(opencode): ACP File write should create the file if it doesn't exist (#12854)
This commit is contained in:
parent
ba740eaefd
commit
56b340b5d5
1 changed files with 2 additions and 2 deletions
|
|
@ -228,8 +228,8 @@ export namespace ACP {
|
|||
const metadata = permission.metadata || {}
|
||||
const filepath = typeof metadata["filepath"] === "string" ? metadata["filepath"] : ""
|
||||
const diff = typeof metadata["diff"] === "string" ? metadata["diff"] : ""
|
||||
|
||||
const content = await Bun.file(filepath).text()
|
||||
const file = Bun.file(filepath)
|
||||
const content = await file.exists() ? await file.text() : ""
|
||||
const newContent = getNewContent(content, diff)
|
||||
|
||||
if (newContent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue