Skip to content

Commit 5da9b02

Browse files
authored
ExecuteAll stage parameter is added.
1 parent b0224b7 commit 5da9b02

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ class ServerlessDynamodbLocal {
4444
}
4545
},
4646
executeAll: {
47-
lifecycleEvents: ['executeAllHandler']
47+
lifecycleEvents: ['executeAllHandler'],
48+
options: {
49+
stage: {
50+
shortcut: 's',
51+
usage: 'Stage that dynamodb should be remotely executed'
52+
}
53+
}
4854
},
4955
start: {
5056
lifecycleEvents: ['startHandler'],
@@ -170,10 +176,12 @@ class ServerlessDynamodbLocal {
170176

171177
executeAllHandler(isOffline) {
172178
let self = this,
173-
region = isOffline ? null :self.service.provider.region
179+
region = isOffline ? null : self.service.provider.region,
180+
options = this.options;
181+
174182
return new BbPromise(function(resolve, reject) {
175183
let dynamodb = self.dynamodbOptions(region),
176-
tableOptions = self.tableOptions();
184+
tableOptions = self.tableOptions(options.stage);
177185
dynamodbMigrations.init(dynamodb, tableOptions.path);
178186
dynamodbMigrations.executeAll(tableOptions).then(resolve, reject);
179187
});

0 commit comments

Comments
 (0)