Skip to content

Commit

Permalink
fix(lambda-at-edge): for serverless-trace, don't copy when source and…
Browse files Browse the repository at this point in the history
… destination are the same (#760)
  • Loading branch information
dphang committed Nov 3, 2020
1 parent e7b5c1d commit 29ef6a6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/libs/lambda-at-edge/src/build.ts
Expand Up @@ -149,10 +149,15 @@ class Builder {
path.relative(this.serverlessDir, resolvedFilePath)
);

return fse.copy(
resolvedFilePath,
join(this.outputDir, handlerDirectory, dst)
);
if (resolvedFilePath !== join(this.outputDir, handlerDirectory, dst)) {
// Only copy when source and destination are different
return fse.copy(
resolvedFilePath,
join(this.outputDir, handlerDirectory, dst)
);
} else {
return Promise.resolve();
}
});
}

Expand Down

0 comments on commit 29ef6a6

Please sign in to comment.