Skip to content

Commit 6a4097d

Browse files
author
bweigel
committed
1 parent 3b20787 commit 6a4097d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/pip.js

+14
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,20 @@ function installRequirementsIfNeeded(
381381
// Our source requirements, under our service path, and our module path (if specified)
382382
const fileName = path.join(servicePath, modulePath, options.fileName);
383383

384+
// Skip requirements generation, if requirements file doesn't exist
385+
if (options.usePipenv) {
386+
if (
387+
!fse.existsSync(path.join(servicePath, 'Pipfile')) &&
388+
!fse.existsSync(fileName)
389+
) {
390+
return false;
391+
}
392+
} else {
393+
if (!fse.existsSync(fileName)) {
394+
return false;
395+
}
396+
}
397+
384398
// First, generate the requirements file to our local .serverless folder
385399
fse.ensureDirSync(path.join(servicePath, '.serverless'));
386400
const slsReqsTxt = path.join(servicePath, '.serverless', 'requirements.txt');

0 commit comments

Comments
 (0)