@@ -23,6 +23,9 @@ function injectRequirements(
23
23
injectionRelativePath ,
24
24
options
25
25
) {
26
+ console . log ( 'requirementsPath' , requirementsPath ) ;
27
+ console . log ( 'injectionRelativePath' , injectionRelativePath ) ;
28
+ console . log ( 'packagePath' , packagePath ) ;
26
29
const noDeploy = new Set ( options . noDeploy || [ ] ) ;
27
30
28
31
return fse
@@ -31,17 +34,21 @@ function injectRequirements(
31
34
. then ( ( zip ) =>
32
35
BbPromise . resolve (
33
36
glob . sync ( [ path . join ( requirementsPath , '**' ) ] , {
37
+ // glob.sync([path.join(packagePath, '..', 'requirements', '**')], {
34
38
mark : true ,
35
39
dot : true ,
36
40
} )
37
41
)
38
- . map ( ( file ) => [
39
- file ,
40
- path . join (
41
- injectionRelativePath ,
42
- path . relative ( requirementsPath , file )
43
- ) ,
44
- ] )
42
+ . map ( ( file ) => {
43
+ // console.log('first map file', file);
44
+ return [
45
+ file ,
46
+ path . join (
47
+ injectionRelativePath ,
48
+ path . relative ( requirementsPath , file )
49
+ ) ,
50
+ ] ;
51
+ } )
45
52
. filter (
46
53
( [ file , relativeFile ] ) =>
47
54
! file . endsWith ( '/' ) &&
@@ -51,12 +58,13 @@ function injectRequirements(
51
58
. map ( ( [ file , relativeFile ] ) =>
52
59
Promise . all ( [ file , relativeFile , fse . statAsync ( file ) ] )
53
60
)
54
- . mapSeries ( ( [ file , relativeFile , fileStat ] ) =>
55
- zipFile ( zip , relativeFile , fse . readFileAsync ( file ) , {
61
+ . mapSeries ( ( [ file , relativeFile , fileStat ] ) => {
62
+ // console.log('file', file);
63
+ return zipFile ( zip , relativeFile , fse . readFileAsync ( file ) , {
56
64
unixPermissions : fileStat . mode ,
57
65
createFolders : false ,
58
- } )
59
- )
66
+ } ) ;
67
+ } )
60
68
. then ( ( ) => writeZip ( zip , packagePath ) )
61
69
) ;
62
70
}
@@ -150,10 +158,16 @@ async function injectAllRequirements(funcArtifact) {
150
158
}
151
159
} )
152
160
. map ( ( func ) => {
161
+ console . log ( 'func.module' , func . module ) ;
153
162
return this . options . zip
154
163
? func
155
164
: injectRequirements (
156
- path . join ( this . serverless . serviceDir , '.serverless' , func . module , 'requirements' ) ,
165
+ path . join (
166
+ this . serverless . serviceDir ,
167
+ '.serverless' ,
168
+ func . module ,
169
+ 'requirements'
170
+ ) ,
157
171
func . package . artifact ,
158
172
injectionRelativePath ,
159
173
this . options
0 commit comments