Skip to content

Commit

Permalink
Fix #194 (#283)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bweigel authored and dschep committed Nov 21, 2018
1 parent 8551233 commit f2d73ea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,20 @@ function installRequirementsIfNeeded(
// Our source requirements, under our service path, and our module path (if specified)
const fileName = path.join(servicePath, modulePath, options.fileName);

// Skip requirements generation, if requirements file doesn't exist
if (options.usePipenv) {
if (
!fse.existsSync(path.join(servicePath, 'Pipfile')) &&
!fse.existsSync(fileName)
) {
return false;
}
} else {
if (!fse.existsSync(fileName)) {
return false;
}
}

// First, generate the requirements file to our local .serverless folder
fse.ensureDirSync(path.join(servicePath, '.serverless'));
const slsReqsTxt = path.join(servicePath, '.serverless', 'requirements.txt');
Expand Down

0 comments on commit f2d73ea

Please sign in to comment.