Skip to content

Commit

Permalink
Fix appending new lines on existing file
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNsbmr committed Sep 14, 2021
1 parent 389696f commit 2e56715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions core/Writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2e56715

Please sign in to comment.