Revert originalContent check for undefined

This commit is contained in:
Saoud Rizwan
2024-08-08 08:50:58 -04:00
parent a5435a662e
commit b2297846d9

View File

@@ -442,12 +442,8 @@ export class ClaudeDev {
.then(() => true) .then(() => true)
.catch(() => false) .catch(() => false)
let originalContent: string | undefined
if (fileExists) { if (fileExists) {
originalContent = await fs.readFile(absolutePath, "utf-8") const originalContent = await fs.readFile(absolutePath, "utf-8")
}
if (fileExists && originalContent && originalContent.length > 0) {
// fix issue where claude always removes newline from the file // fix issue where claude always removes newline from the file
if (originalContent.endsWith("\n") && !newContent.endsWith("\n")) { if (originalContent.endsWith("\n") && !newContent.endsWith("\n")) {
newContent += "\n" newContent += "\n"