Skip to content

Commit a1a2328

Browse files
committed
Merge branch 'master' of github.com:evennode/serverless-step-functions-local
2 parents 006425a + ab228a3 commit a1a2328

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

index.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ServerlessStepFunctionsLocal {
5858

5959
const bootstrap = (async () => {
6060
await this.startStepFunctions();
61-
await this.getStepFunctionsFromConfig();
61+
await this.getStepFunctionsFromConfigurationInput();
6262
await this.createEndpoints();
6363
})()
6464

@@ -103,24 +103,17 @@ class ServerlessStepFunctionsLocal {
103103
return this.stepfunctionsServer.stop();
104104
}
105105

106-
async getStepFunctionsFromConfig() {
107-
const {servicePath} = this.serverless.config;
108-
109-
if (!servicePath) {
110-
throw new Error('service path not found');
111-
}
112-
113-
const configPath = path.join(servicePath, 'serverless.yml');
114-
115-
const preParsed = await this.serverless.yamlParser.parse(configPath);
116-
const parsed = await this.serverless.variables.populateObject(preParsed);
117-
118-
this.stateMachines = this.stateMachineCFARNResolver(parsed.stepFunctions.stateMachines);
119-
120-
if (parsed.custom
121-
&& parsed.custom.stepFunctionsLocal
122-
&& parsed.custom.stepFunctionsLocal.TaskResourceMapping) {
123-
this.replaceTaskResourceMappings(parsed.stepFunctions.stateMachines, parsed.custom.stepFunctionsLocal.TaskResourceMapping);
106+
async getStepFunctionsFromConfigurationInput() {
107+
this.stateMachines = this.stateMachineCFARNResolver(this.serverless.configurationInput.stepFunctions.stateMachines);
108+
109+
if (this.serverless.configurationInput.custom
110+
&& this.serverless.configurationInput.custom.stepFunctionsLocal
111+
&& this.serverless.configurationInput.custom.stepFunctionsLocal.TaskResourceMapping
112+
) {
113+
this.replaceTaskResourceMappings(
114+
this.serverless.configurationInput.stepFunctions.stateMachines,
115+
this.serverless.configurationInput.custom.stepFunctionsLocal.TaskResourceMapping
116+
);
124117
}
125118
}
126119

0 commit comments

Comments
 (0)