Skip to content

Commit f2d73ea

Browse files
bweigeldschep
authored andcommitted
Fix #194 (#283)
Closes #194 <strike>...no clue why git(hub) thinks there are 5 commits & 9 changed files (all those changes are already in the master; on which I rebased before branching)</strike>
1 parent 8551233 commit f2d73ea

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)