Skip to content

Commit ea21b58

Browse files
author
Alice
committed
Merge branch 'master' into feature/early-return-map
2 parents 4649e55 + 2cce7c3 commit ea21b58

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@beforeyoubid/serverless-step-functions-offline",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Serverlesss plugin to support step function offline",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
5959
private parallelBranch: Maybe<Branch>;
6060
private eventParallelResult: Event[] = [];
6161

62+
shouldTerminate = true;
6263
serverless: ServerlessWithError;
6364
options: Options;
6465
commands: Plugin['commands'];
@@ -90,6 +91,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
9091
'loadEventFile',
9192
'loadEnvVariables',
9293
'buildStepWorkFlow',
94+
'exit',
9395
],
9496
options: {
9597
stateMachine: {
@@ -115,9 +117,14 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
115117
'step-functions-offline:loadEventFile': this.loadEventFile.bind(this),
116118
'step-functions-offline:loadEnvVariables': this.loadEnvVariables.bind(this),
117119
'step-functions-offline:buildStepWorkFlow': this.buildStepWorkFlow.bind(this),
120+
'step-functions-offline:exit': this.exit.bind(this),
118121
};
119122
}
120123

124+
exit(): void {
125+
if (this.shouldTerminate) process.exit(0);
126+
}
127+
121128
// Entry point for the plugin (sls step offline)
122129
start(): void {
123130
this.cliLog('Preparing....');

0 commit comments

Comments
 (0)