@@ -12,7 +12,7 @@ const {
1212 checkForAndDeleteMaxCacheVersions,
1313 sha256Path,
1414 getRequirementsWorkingPath,
15- getUserCachePath
15+ getUserCachePath,
1616} = require ( './shared' ) ;
1717
1818/**
@@ -22,7 +22,7 @@ const {
2222 * @return {string[][] } a list of valid commands.
2323 */
2424function filterCommands ( commands ) {
25- return commands . filter ( cmd => Boolean ( cmd ) && cmd . length > 0 ) ;
25+ return commands . filter ( ( cmd ) => Boolean ( cmd ) && cmd . length > 0 ) ;
2626}
2727
2828/**
@@ -129,7 +129,7 @@ function installRequirements(targetFolder, serverless, options) {
129129 Array . isArray ( options . pipCmdExtraArgs ) &&
130130 options . pipCmdExtraArgs . length > 0
131131 ) {
132- options . pipCmdExtraArgs . forEach ( cmd => {
132+ options . pipCmdExtraArgs . forEach ( ( cmd ) => {
133133 const parts = cmd . split ( / \s + / , 2 ) ;
134134 pipCmd . push ( ...parts ) ;
135135 } ) ;
@@ -140,9 +140,11 @@ function installRequirements(targetFolder, serverless, options) {
140140 // Check if we're using the legacy --cache-dir command...
141141 if ( options . pipCmdExtraArgs . indexOf ( '--cache-dir' ) > - 1 ) {
142142 if ( options . dockerizePip ) {
143- throw 'Error: You can not use --cache-dir with Docker any more, please\n' +
143+ throw (
144+ 'Error: You can not use --cache-dir with Docker any more, please\n' +
144145 ' use the new option useDownloadCache instead. Please see:\n' +
145- ' https://github.com/UnitedIncome/serverless-python-requirements#caching' ;
146+ ' https://github.com/UnitedIncome/serverless-python-requirements#caching'
147+ ) ;
146148 } else {
147149 serverless . cli . log ( '==================================================' ) ;
148150 serverless . cli . log (
@@ -239,7 +241,7 @@ function installRequirements(targetFolder, serverless, options) {
239241
240242 if ( options . dockerEnv ) {
241243 // Add environment variables to docker run cmd
242- options . dockerEnv . forEach ( function ( item ) {
244+ options . dockerEnv . forEach ( function ( item ) {
243245 dockerCmd . push ( '-e' , item ) ;
244246 } ) ;
245247 }
@@ -256,7 +258,7 @@ function installRequirements(targetFolder, serverless, options) {
256258 'chown' ,
257259 '-R' ,
258260 `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
259- '/var/task'
261+ '/var/task' ,
260262 ] ) ;
261263 } else {
262264 // Use same user so --cache-dir works
@@ -274,7 +276,7 @@ function installRequirements(targetFolder, serverless, options) {
274276 'chown' ,
275277 '-R' ,
276278 `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
277- dockerDownloadCacheDir
279+ dockerDownloadCacheDir ,
278280 ] ) ;
279281 }
280282 }
@@ -384,7 +386,7 @@ function filterRequirementsFile(source, target, options, serverless) {
384386 const noDeploy = new Set ( options . noDeploy || [ ] ) ;
385387 const requirements = getRequirements ( source ) ;
386388 var prepend = [ ] ;
387- const filteredRequirements = requirements . filter ( req => {
389+ const filteredRequirements = requirements . filter ( ( req ) => {
388390 req = req . trim ( ) ;
389391 if ( req . startsWith ( '#' ) ) {
390392 // Skip comments
@@ -440,7 +442,7 @@ function copyVendors(vendorFolder, targetFolder, serverless) {
440442 `Copying vendor libraries from ${ vendorFolder } to ${ targetFolder } ...`
441443 ) ;
442444
443- fse . readdirSync ( vendorFolder ) . map ( file => {
445+ fse . readdirSync ( vendorFolder ) . map ( ( file ) => {
444446 let source = path . join ( vendorFolder , file ) ;
445447 let dest = path . join ( targetFolder , file ) ;
446448 if ( fse . existsSync ( dest ) ) {
@@ -603,12 +605,12 @@ function installAllRequirements() {
603605 if ( this . serverless . service . package . individually ) {
604606 let doneModules = [ ] ;
605607 this . targetFuncs
606- . filter ( func =>
608+ . filter ( ( func ) =>
607609 ( func . runtime || this . serverless . service . provider . runtime ) . match (
608610 / ^ p y t h o n .* /
609611 )
610612 )
611- . map ( f => {
613+ . map ( ( f ) => {
612614 if ( ! get ( f , 'module' ) ) {
613615 set ( f , [ 'module' ] , '.' ) ;
614616 }
0 commit comments