@@ -232,10 +232,7 @@ function installRequirementsIfNeeded(servicePath, modulePath, options, serverles
232
232
// First, generate the requirements file to our local .serverless folder
233
233
fse . ensureDirSync ( path . join ( servicePath , '.serverless' ) ) ;
234
234
const slsReqsTxt = path . join ( servicePath , '.serverless' , 'requirements.txt' ) ;
235
- // Incase it's laying around from a previous package (when individually/failed packaging)
236
- if ( fse . existsSync ( slsReqsTxt ) ) {
237
- fse . removeSync ( slsReqsTxt ) ;
238
- }
235
+
239
236
installRequirementsFile (
240
237
fileName ,
241
238
slsReqsTxt ,
@@ -267,7 +264,6 @@ function installRequirementsIfNeeded(servicePath, modulePath, options, serverles
267
264
serverless . cli . log ( `Using static cache of requirements found at ${ workingReqsFolder } ...` ) ;
268
265
// We'll "touch" the folder, as to bring it to the start of the FIFO cache
269
266
fse . utimesSync ( workingReqsFolder , new Date ( ) , new Date ( ) ) ;
270
- fse . removeSync ( slsReqsTxt ) ;
271
267
return workingReqsFolder ;
272
268
}
273
269
// Remove our old folder if it didn't complete properly, but _just incase_ only remove it if named properly...
@@ -302,7 +298,6 @@ function installRequirementsIfNeeded(servicePath, modulePath, options, serverles
302
298
if ( options . useStaticCache ) {
303
299
fse . closeSync ( fse . openSync ( path . join ( workingReqsFolder , '.completed_requirements' ) , 'w' ) ) ;
304
300
}
305
- fse . removeSync ( slsReqsTxt ) ; // Clean up after ourselves
306
301
return workingReqsFolder ;
307
302
}
308
303
0 commit comments