Skip to content

Commit 45c5dd1

Browse files
authored
fix(aws): make reading/writing of aws manifest consistent with other packages (#603)
1 parent f4949f4 commit 45c5dd1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/targets/awsLambdaLayer.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,12 @@ export class AwsLambdaLayerTarget extends BaseTarget {
316316

317317
if (!fs.existsSync(baseFilepath)) {
318318
this.logger.warn(`The ${runtime.name} base file is missing.`);
319-
fs.writeFileSync(newVersionFilepath, JSON.stringify(runtimeData));
319+
const manifestString = JSON.stringify(runtimeData, undefined, 2) + '\n';
320+
fs.writeFileSync(newVersionFilepath, manifestString);
320321
} else {
321-
const baseData = JSON.parse(fs.readFileSync(baseFilepath).toString());
322-
fs.writeFileSync(
323-
newVersionFilepath,
324-
JSON.stringify({ ...baseData, ...runtimeData })
325-
);
322+
const baseData = JSON.parse(fs.readFileSync(baseFilepath, { encoding: 'utf-8' }).toString());
323+
const manifestString = JSON.stringify({ ...baseData, ...runtimeData }, undefined, 2) + '\n';
324+
fs.writeFileSync(newVersionFilepath, manifestString);
326325
}
327326

328327
this.createVersionSymlinks(runtimeBaseDir, version, newVersionFilepath);

0 commit comments

Comments
 (0)