try fixing annoying package.json differences

This commit is contained in:
Adam 2022-07-06 16:51:00 +02:00
parent 9dbd6f68f3
commit c4f74fd3ca

View file

@ -50,6 +50,12 @@ abstract class UpdatePackageJson @Inject constructor(
val packageJsonContentUpdated =
jsonMapper
.encodeToString(updatedPackageJson)
// change empty arrays/objects, because `npm install` also formats package.json, but
// slightly differently to kxs.
.replace(": {\n },", ": {},")
.replace(": [\n ],", ": [],")
.suffixIfNot("\n")
logger.debug(packageJsonContentUpdated)