scripts/prepare-release: properly indent and encode package.json

Co-authored-by: blam <ben@blam.sh>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-28 16:10:12 +01:00
parent bf06801f94
commit 9705c336a7
+10 -5
View File
@@ -102,6 +102,7 @@ async function updatePatchVersions() {
if (hasChanges) {
await fs.writeJson(path.resolve(dir, 'package.json'), packageJson, {
spaces: 2,
encoding: 'utf8',
});
}
}
@@ -109,7 +110,7 @@ async function updatePatchVersions() {
await fs.writeJSON(
patchedJsonPath,
{ currentReleaseVersion: {} },
{ spaces: 2 },
{ spaces: 2, encoding: 'utf8' },
);
}
@@ -165,10 +166,14 @@ async function updateBackstageReleaseVersion() {
nextVersion = semver.inc(currentVersion, 'patch');
}
await fs.writeJson(packagePath, {
...package,
version: nextVersion,
});
await fs.writeJson(
packagePath,
{
...package,
version: nextVersion,
},
{ spaces: 2, encoding: 'utf8' },
);
}
async function main() {