Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/aws-serverless/scripts/buildLambdaLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ function run(cmd: string, options?: childProcess.ExecSyncOptions): string {
async function buildLambdaLayer(): Promise<void> {
console.log('Building Lambda layer.');
console.log('Installing local @sentry/aws-serverless into build/aws/dist-serverless/nodejs.');
run('npm install . --prefix ./build/aws/dist-serverless/nodejs --install-links --silent');

console.log('Creating target directory for npm install.');
fsForceMkdirSync('./build/aws/dist-serverless/nodejs');

run('npm install . --prefix ./build/aws/dist-serverless/nodejs --install-links');

await pruneNodeModules();
fs.rmSync('./build/aws/dist-serverless/nodejs/package.json', { force: true });
Expand Down Expand Up @@ -60,7 +64,7 @@ buildLambdaLayer();
*/
function fsForceMkdirSync(path: string): void {
fs.rmSync(path, { recursive: true, force: true });
fs.mkdirSync(path);
fs.mkdirSync(path, { recursive: true });
}

async function pruneNodeModules(): Promise<void> {
Expand Down
Loading