Skip to content

Commit 7853929

Browse files
committed
Implement custom install path
1 parent 3aece40 commit 7853929

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ class ServerlessDynamodbLocal {
1111
this.service = serverless.service;
1212
this.serverlessLog = serverless.cli.log.bind(serverless.cli);
1313
this.config = this.service.custom && this.service.custom.dynamodb || {};
14-
this.options = options;
14+
this.options = _.merge({
15+
localPath: path.join(serverless.config.servicePath, '.dynamodb')
16+
},
17+
options
18+
);
1519
this.provider = "aws";
1620
this.commands = {
1721
dynamodb: {
@@ -124,7 +128,7 @@ class ServerlessDynamodbLocal {
124128

125129
if(options && options.online){
126130
this.serverlessLog("Connecting to online tables...");
127-
if (!options.region) {
131+
if (!options.region) {
128132
throw new Error("please specify the region");
129133
}
130134
dynamoOptions = {
@@ -152,7 +156,7 @@ class ServerlessDynamodbLocal {
152156
}
153157

154158
seedHandler() {
155-
const options = this.options;
159+
const options = this.options;
156160
const dynamodb = this.dynamodbOptions(options);
157161

158162
return BbPromise.each(this.seedSources, (source) => {
@@ -179,7 +183,8 @@ class ServerlessDynamodbLocal {
179183
startHandler() {
180184
const config = this.config;
181185
const options = _.merge({
182-
sharedDb: this.options.sharedDb || true
186+
sharedDb: this.options.sharedDb || true,
187+
install_path: this.options.localPath
183188
},
184189
config && config.start,
185190
this.options

0 commit comments

Comments
 (0)