From 2e5671500da5d0c15fc5cf24e4e614ac5d15cac8 Mon Sep 17 00:00:00 2001 From: Alexandre Nussbaumer Date: Tue, 14 Sep 2021 13:36:31 +0200 Subject: [PATCH] Fix appending new lines on existing file --- core/Writer.js | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/Writer.js b/core/Writer.js index 95d33e43..d5fb64be 100644 --- a/core/Writer.js +++ b/core/Writer.js @@ -6,10 +6,7 @@ const FileWriter = function() { FileWriter.prototype.write = function(filePath, encoding, lines, transformer, options) { let fileContent = '' - if (fs.existsSync(filePath)) { - fileContent = fs.readFileSync(filePath, encoding); - } - + const valueToInsert = this.getTransformedLines(lines, transformer) const output = transformer.insert(fileContent, valueToInsert, options) diff --git a/package.json b/package.json index 3f7bc755..e295793e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ }, "name": "localize-with-spreadsheet-2", "description": "Create a localization file in Android or iOS format from a Google Spreadsheet. Version 2", - "version": "3.0.0", + "version": "3.0.2", "homepage": "https://github.com/NeverwinterMoon/localize-with-spreadsheet-2", "repository": { "type": "git",