Skip to content

Commit 66b54e3

Browse files
author
Farley
committed
Fixing single function deploys (pertaining to this feature, they are still broken from upstream however)
1 parent 80bdb55 commit 66b54e3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/pip.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,9 @@ function installAllRequirements() {
304304
this.servicePath, f.module, this.options, this.serverless
305305
);
306306
// Add symlinks into .serverless for each module so it's easier for injecting and for users to see where reqs are
307-
if (reqsInstalledAt) {
308-
fse.symlink(
309-
reqsInstalledAt,
310-
path.join(this.servicePath, '.serverless', `${f.module}_requirements`)
311-
);
307+
let symlinkPath = path.join(this.servicePath, '.serverless', `${f.module}_requirements`);
308+
if (reqsInstalledAt && !fse.existsSync(symlinkPath)) {
309+
fse.symlink( reqsInstalledAt, symlinkPath );
312310
}
313311
doneModules.push(f.module);
314312
}
@@ -318,8 +316,9 @@ function installAllRequirements() {
318316
this.servicePath, '', this.options, this.serverless
319317
);
320318
// Add symlinks into .serverless for so it's easier for injecting and for users to see where reqs are
321-
if (reqsInstalledAt) {
322-
fse.symlink(reqsInstalledAt, path.join(this.servicePath, '.serverless', `_requirements`));
319+
let symlinkPath = path.join(this.servicePath, '.serverless', `_requirements`);
320+
if (reqsInstalledAt && !fse.existsSync(symlinkPath)) {
321+
fse.symlink(reqsInstalledAt, symlinkPath);
323322
}
324323
}
325324
};

0 commit comments

Comments
 (0)