@@ -2,10 +2,7 @@ const BbPromise = require('bluebird');
22const fse = require ( 'fs-extra' ) ;
33const path = require ( 'path' ) ;
44const JSZip = require ( 'jszip' ) ;
5- const {
6- writeZip,
7- addTree
8- } = require ( './zipTree' ) ;
5+ const { writeZip, addTree } = require ( './zipTree' ) ;
96
107BbPromise . promisifyAll ( fse ) ;
118
@@ -17,10 +14,10 @@ function getRunTimeBuildPaths() {
1714 const runtimepaths = {
1815 'python2.7' : 'python' ,
1916 'python3.6' : path . join ( 'python' , 'lib' , 'python3.6' , 'site-packages' ) ,
20- 'python3.7' : path . join ( 'python' , 'lib' , 'python3.7' , 'site-packages' ) ,
17+ 'python3.7' : path . join ( 'python' , 'lib' , 'python3.7' , 'site-packages' )
2118 } ;
2219
23- let runtimes = [ ]
20+ let runtimes = [ ] ;
2421
2522 // Defer to Layer config first
2623 if ( this . options . layer . compatibleRuntimes ) {
@@ -43,22 +40,27 @@ function getRunTimeBuildPaths() {
4340 */
4441function zipRequirements ( runtimepaths ) {
4542 const rootZip = new JSZip ( ) ;
46- const src = path . join ( '.serverless' , 'requirements' )
43+ const src = path . join ( '.serverless' , 'requirements' ) ;
4744
48- return BbPromise . each ( runtimepaths , ( runtimepath ) => addTree ( rootZip . folder ( runtimepath ) , src ) )
49- . then ( ( ) => writeZip ( rootZip , path . join ( '.serverless' , 'pythonRequirementsLayer.zip' ) ) )
45+ return BbPromise . each ( runtimepaths , runtimepath =>
46+ addTree ( rootZip . folder ( runtimepath ) , src )
47+ ) . then ( ( ) =>
48+ writeZip ( rootZip , path . join ( '.serverless' , 'pythonRequirementsLayer.zip' ) )
49+ ) ;
5050}
5151
5252/**
5353 * Creates a layer on the serverless service for the requirements zip.
5454 * @return {Promise } empty promise
5555 */
5656function createLayers ( ) {
57- this . serverless . service . layers [ 'pythonRequirements' ] = Object . assign ( {
57+ this . serverless . service . layers [ 'pythonRequirements' ] = Object . assign (
58+ {
5859 artifact : path . join ( '.serverless' , 'pythonRequirements.zip' ) ,
5960 name : `${ this . serverless . service . stage } -python-requirements` ,
60- description : 'Python requirements generated by serverless-python-requirements.' ,
61- compatibleRuntimes : [ this . serverless . service . provider . runtime ] ,
61+ description :
62+ 'Python requirements generated by serverless-python-requirements.' ,
63+ compatibleRuntimes : [ this . serverless . service . provider . runtime ]
6264 } ,
6365 this . options . layer
6466 ) ;
0 commit comments