mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
don't overwrite the event.data.event if it exists already
This commit is contained in:
parent
6cd6dd7b2d
commit
a6a2f164af
@ -119,6 +119,9 @@ module.exports = function(S) {
|
||||
// Missing function
|
||||
if (!this.function) return BbPromise.reject(new SError(`Function ${this.evt.options.name} does not exist in your project.`));
|
||||
|
||||
// load event data if not it not present already
|
||||
if (this.evt.data.event) return BbPromise.resolve();
|
||||
|
||||
return this._getEventFromStdIn()
|
||||
.then(event => event || S.utils.readFile(this.function.getRootPath('event.json')))
|
||||
.then(event => this.evt.data.event = event);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user