Skip to content

Commit

Permalink
Add newline at end of json files (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
job13er authored Sep 28, 2023
1 parent c4bc122 commit b47369a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/bumpr.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function bumpVersion(fullPath, info) {
// eslint-disable-next-line no-param-reassign
info.version = newVersion
src.version = newVersion
return fsWriteFile(fullPath, JSON.stringify(src, null, 2), {encoding: 'utf-8'})
return fsWriteFile(fullPath, `${JSON.stringify(src, null, 2)}\n`, {encoding: 'utf-8'})
})
}

Expand Down Expand Up @@ -565,7 +565,7 @@ class Bumpr {

const filename = this.config.features.logging.file
Logger.log(`Writing ${JSON.stringify(logInfo)} to ${filename}`)
return writeFile(filename, JSON.stringify(logInfo, null, 2)).then(() => info)
return writeFile(filename, `${JSON.stringify(logInfo, null, 2)}\n`).then(() => info)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/tests/bumpr.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ describe('Bumpr', () => {
scope: 'patch',
version: '1.2.3',
}
expect(writeFile).toHaveBeenCalledWith('the-log-file', JSON.stringify(logInfo, null, 2))
expect(writeFile).toHaveBeenCalledWith('the-log-file', `${JSON.stringify(logInfo, null, 2)}\n`)
})

it('should resolve with the info', () => {
Expand Down

0 comments on commit b47369a

Please sign in to comment.