Serverless classes are now loaded before setProject() call

This commit is contained in:
Kamil Burzynski 2016-02-10 09:18:28 +01:00
parent 8a072fd7cd
commit e570f077e2

View File

@ -39,16 +39,7 @@ class Serverless {
serverlessPath: __dirname
};
this.setProject( project );
// Add Config Settings
this.updateConfig(config);
// Add Defaults
this.actions = {};
this.hooks = {};
this.commands = {};
this.classes = {
this.classes = {
// TODO: add Runtime, Stage, Region
State: require('./ServerlessState'),
Meta: require('./ServerlessMeta'),
@ -58,6 +49,16 @@ class Serverless {
Endpoint: require('./ServerlessEndpoint'),
Event: require('./ServerlessEvent')
};
this.setProject( project );
// Add Config Settings
this.updateConfig(config);
// Add Defaults
this.actions = {};
this.hooks = {};
this.commands = {};
this.cli = null;
this.state = new this.classes.State(this);