try fixing annoying package.json differences

This commit is contained in:
Adam 2022-07-06 17:08:00 +02:00
parent c4f74fd3ca
commit 3affed66d6

View file

@ -31,9 +31,9 @@ abstract class UpdatePackageJson @Inject constructor(
init { init {
group = NodePlugin.NODE_GROUP group = NodePlugin.NPM_GROUP
description = description =
"Read the package.json file and update the version and name, based on the project." "Read the package.json file and update the version and name, based on the current project."
outputs.upToDateWhen(JsonPropertiesUpToDateSpec) outputs.upToDateWhen(JsonPropertiesUpToDateSpec)
} }
@ -53,8 +53,8 @@ abstract class UpdatePackageJson @Inject constructor(
// change empty arrays/objects, because `npm install` also formats package.json, but // change empty arrays/objects, because `npm install` also formats package.json, but
// slightly differently to kxs. // slightly differently to kxs.
.replace(": {\n },", ": {},") .replace( ": {\n }", ": {}")
.replace(": [\n ],", ": [],") .replace( ": [\n ]", ": []")
.suffixIfNot("\n") .suffixIfNot("\n")