diff --git a/lib/actions/ComponentCreate.js b/lib/actions/ComponentCreate.js index 98656e3ff..5a7fc19c6 100644 --- a/lib/actions/ComponentCreate.js +++ b/lib/actions/ComponentCreate.js @@ -169,6 +169,7 @@ usage: serverless component create`, sPath: this.evt.options.name }); this.S.state.setAsset(component); + this.evt.data.sPath = component._config.sPath; return component.save(); }; diff --git a/tests/tests/actions/ComponentCreate.js b/tests/tests/actions/ComponentCreate.js index 5dcf501c9..f378bcd91 100644 --- a/tests/tests/actions/ComponentCreate.js +++ b/tests/tests/actions/ComponentCreate.js @@ -23,6 +23,7 @@ let serverless; let validateEvent = function(evt) { assert.equal(true, typeof evt.options.name != 'undefined'); assert.equal(true, typeof evt.options.runtime != 'undefined'); + assert.equal(true, typeof evt.data.sPath != 'undefined'); }; describe('Test action: Component Create', function() {