Skip to content

Commit

Permalink
SFE support when using package:individually
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Oct 28, 2019
1 parent c9d910c commit 2ab01cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@ function moveModuleUp(source, target, module) {
return fse
.readFileAsync(source)
.then(buffer => JSZip.loadAsync(buffer))
.then(sourceZip => sourceZip.filter(file => file.startsWith(module + '/')))
.then(sourceZip =>
sourceZip.filter(
file =>
file.startsWith(module + '/') ||
file.startsWith('serverless_sdk/') ||
file.match(/s_.*\.py/) !== null
)
)
.map(srcZipObj =>
zipFile(
targetZip,
srcZipObj.name.replace(module + '/', ''),
srcZipObj.name.startsWith(module + '/')
? srcZipObj.name.replace(module + '/', '')
: srcZipObj.name,
srcZipObj.async('nodebuffer')
)
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-python-requirements",
"version": "5.0.0",
"version": "5.0.1",
"engines": {
"node": ">=6.0"
},
Expand Down

0 comments on commit 2ab01cf

Please sign in to comment.