mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 10:02:51 +00:00
chore: generate
This commit is contained in:
@@ -633,11 +633,13 @@ export const maybeParseApplyPatchVerified = Effect.fn("Patch.maybeParseApplyPatc
|
||||
|
||||
case "update": {
|
||||
const updatePath = path.resolve(effectiveCwd, hunk.path)
|
||||
const originalText = yield* fs.readFileString(updatePath).pipe(
|
||||
Effect.catch((cause) =>
|
||||
Effect.succeed(new Error(`Failed to read file ${updatePath}: ${cause}`, { cause })),
|
||||
),
|
||||
)
|
||||
const originalText = yield* fs
|
||||
.readFileString(updatePath)
|
||||
.pipe(
|
||||
Effect.catch((cause) =>
|
||||
Effect.succeed(new Error(`Failed to read file ${updatePath}: ${cause}`, { cause })),
|
||||
),
|
||||
)
|
||||
if (originalText instanceof Error) {
|
||||
return {
|
||||
type: MaybeApplyPatchVerified.CorrectnessError,
|
||||
|
||||
@@ -119,7 +119,11 @@ export const ApplyPatchTool = Tool.define(
|
||||
|
||||
// Apply the update chunks to get new content
|
||||
try {
|
||||
const fileUpdate = Patch.deriveNewContentsFromChunks(filePath, hunk.chunks, Bom.join(source.text, source.bom))
|
||||
const fileUpdate = Patch.deriveNewContentsFromChunks(
|
||||
filePath,
|
||||
hunk.chunks,
|
||||
Bom.join(source.text, source.bom),
|
||||
)
|
||||
newContent = fileUpdate.content
|
||||
bom = fileUpdate.bom
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user