From 9705c336a74faabca59dfeabf8480785dea129c0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 28 Jan 2022 16:10:12 +0100 Subject: [PATCH] scripts/prepare-release: properly indent and encode package.json Co-authored-by: blam Signed-off-by: Patrik Oldsberg --- scripts/prepare-release.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/prepare-release.js b/scripts/prepare-release.js index dd147daca0..7bb3794d9c 100755 --- a/scripts/prepare-release.js +++ b/scripts/prepare-release.js @@ -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() {