mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix issue where for some users fs readfile was returning undefined instead of failing
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user