mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix issue where for some users fs readfile was returning undefined instead of failing
This commit is contained in:
parent
911dd159cd
commit
d44cc99ce1
1 changed files with 7 additions and 1 deletions
|
|
@ -419,8 +419,14 @@ export class ClaudeDev {
|
|||
.access(absolutePath)
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
|
||||
// Some users reported that fs readfile would return undefined instead of failing
|
||||
let originalContent: string | undefined
|
||||
if (fileExists) {
|
||||
const originalContent = await fs.readFile(absolutePath, "utf-8")
|
||||
originalContent = await fs.readFile(absolutePath, "utf-8")
|
||||
}
|
||||
|
||||
if (fileExists && originalContent && originalContent.length > 0) {
|
||||
// fix issue where claude always removes newline from the file
|
||||
if (originalContent.endsWith("\n") && !newContent.endsWith("\n")) {
|
||||
newContent += "\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue