Fixed bug when end of file in package.json has changed when version bumped
parent
c3a1c6e042
commit
8a32db0dc1
|
@ -18,6 +18,7 @@ module.exports = class Json extends BaseVersioning {
|
|||
|
||||
// Parse the file
|
||||
let jsonContent
|
||||
let eol = fileContent.endsWith('\n') ? '\n' : ''
|
||||
try {
|
||||
jsonContent = JSON.parse(fileContent)
|
||||
} catch (error) {
|
||||
|
@ -45,7 +46,7 @@ module.exports = class Json extends BaseVersioning {
|
|||
|
||||
// Update the file
|
||||
this.update(
|
||||
JSON.stringify(jsonContent, null, 2),
|
||||
JSON.stringify(jsonContent, null, 2) + eol
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue