File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,18 @@ class ServerlessPythonRequirements {
109
109
}
110
110
} ;
111
111
112
+ const isFunctionRuntimePython = args => {
113
+ // If functionObj.runtime is undefined, python.
114
+ if ( ! args [ 1 ] . functionObj || ! args [ 1 ] . functionObj . runtime ) {
115
+ return true ;
116
+ }
117
+ return args [ 1 ] . functionObj . runtime . startsWith ( 'python' ) ;
118
+ } ;
119
+
112
120
const before = ( ) => {
113
- if (
114
- arguments [ 1 ] . functionObj &&
115
- arguments [ 1 ] . functionObj . runtime &&
116
- ! arguments [ 1 ] . functionObj . runtime . startsWith ( 'python' )
117
- )
121
+ if ( ! isFunctionRuntimePython ( arguments ) ) {
118
122
return ;
123
+ }
119
124
return BbPromise . bind ( this )
120
125
. then ( pipfileToRequirements )
121
126
. then ( addVendorHelper )
@@ -124,12 +129,9 @@ class ServerlessPythonRequirements {
124
129
} ;
125
130
126
131
const after = ( ) => {
127
- if (
128
- arguments [ 1 ] . functionObj &&
129
- arguments [ 1 ] . functionObj . runtime &&
130
- ! arguments [ 1 ] . functionObj . runtime . startsWith ( 'python' )
131
- )
132
+ if ( ! isFunctionRuntimePython ( arguments ) ) {
132
133
return ;
134
+ }
133
135
return BbPromise . bind ( this )
134
136
. then ( removeVendorHelper )
135
137
. then ( ( ) =>
You can’t perform that action at this time.
0 commit comments