Skip to content

Commit a902f17

Browse files
committed
Fix corrupted zip archive in case of same module
1 parent 5a72d5c commit a902f17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/inject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function injectAllRequirements() {
9595
.map(func => {
9696
if (func.module !== '.') {
9797
const artifact = func.package.artifact;
98-
const newArtifact = path.join('.serverless', `${func.module}.zip`);
98+
const newArtifact = path.join('.serverless', `${func.module}-${func.name}.zip`);
9999
func.package.artifact = newArtifact;
100100
return moveModuleUp(artifact, newArtifact, func.module).then(
101101
() => func

test.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ teardown() {
197197
cd tests/individually
198198
npm i $(npm pack ../..)
199199
sls package
200-
unzip .serverless/module1.zip -d puck
201-
unzip .serverless/module2.zip -d puck2
200+
unzip .serverless/module1-sls-py-req-test-indiv.zip -d puck
201+
unzip .serverless/module2-sls-py-req-test-indiv.zip -d puck2
202202
ls puck/handler1.py
203203
ls puck2/handler2.py
204204
ls puck/pyaml

0 commit comments

Comments
 (0)