From 473657eb115fbc7d80ee6fc764bbfb697770bd3a Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Wed, 11 Jun 2025 14:16:08 +0200 Subject: [PATCH] fix(aws): make reading/writing of aws manifest consistent with other packages --- src/targets/awsLambdaLayer.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/targets/awsLambdaLayer.ts b/src/targets/awsLambdaLayer.ts index e4245aef..d81646db 100644 --- a/src/targets/awsLambdaLayer.ts +++ b/src/targets/awsLambdaLayer.ts @@ -316,13 +316,12 @@ export class AwsLambdaLayerTarget extends BaseTarget { if (!fs.existsSync(baseFilepath)) { this.logger.warn(`The ${runtime.name} base file is missing.`); - fs.writeFileSync(newVersionFilepath, JSON.stringify(runtimeData)); + const manifestString = JSON.stringify(runtimeData, undefined, 2) + '\n'; + fs.writeFileSync(newVersionFilepath, manifestString); } else { - const baseData = JSON.parse(fs.readFileSync(baseFilepath).toString()); - fs.writeFileSync( - newVersionFilepath, - JSON.stringify({ ...baseData, ...runtimeData }) - ); + const baseData = JSON.parse(fs.readFileSync(baseFilepath, { encoding: 'utf-8' }).toString()); + const manifestString = JSON.stringify({ ...baseData, ...runtimeData }, undefined, 2) + '\n'; + fs.writeFileSync(newVersionFilepath, manifestString); } this.createVersionSymlinks(runtimeBaseDir, version, newVersionFilepath);