Skip to content

Commit 2cce7c3

Browse files
author
Alice
authored
Merge pull request #7 from beforeyoubid/feature/fixed-exit
fixed exiting - v2.4.1
2 parents de682e1 + 69145c7 commit 2cce7c3

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
@@ -58,6 +58,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
5858
private parallelBranch: Maybe<Branch>;
5959
private eventParallelResult: Event[] = [];
6060

61+
shouldTerminate = true;
6162
serverless: ServerlessWithError;
6263
options: Options;
6364
commands: Plugin['commands'];
@@ -88,6 +89,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
8889
'loadEventFile',
8990
'loadEnvVariables',
9091
'buildStepWorkFlow',
92+
'exit',
9193
],
9294
options: {
9395
stateMachine: {
@@ -113,9 +115,14 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
113115
'step-functions-offline:loadEventFile': this.loadEventFile.bind(this),
114116
'step-functions-offline:loadEnvVariables': this.loadEnvVariables.bind(this),
115117
'step-functions-offline:buildStepWorkFlow': this.buildStepWorkFlow.bind(this),
118+
'step-functions-offline:exit': this.exit.bind(this),
116119
};
117120
}
118121

122+
exit(): void {
123+
if (this.shouldTerminate) process.exit(0);
124+
}
125+
119126
// Entry point for the plugin (sls step offline)
120127
start(): void {
121128
this.cliLog('Preparing....');

0 commit comments

Comments
 (0)