Skip to content

Commit bf419a1

Browse files
authored
Merge pull request #171 from aneilbaboo/aneil/allowCustomInstallPath
Allow custom install path
2 parents 08d796f + 61c95f8 commit bf419a1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ const BbPromise = require("bluebird");
44
const AWS = require("aws-sdk");
55
const dynamodbLocal = require("dynamodb-localhost");
66
const seeder = require("./src/seeder");
7+
const path = require('path');
78

89
class ServerlessDynamodbLocal {
910
constructor(serverless, options) {
1011
this.serverless = serverless;
1112
this.service = serverless.service;
1213
this.serverlessLog = serverless.cli.log.bind(serverless.cli);
13-
this.options = options;
14+
this.config = this.service.custom && this.service.custom.dynamodb || {};
15+
this.options = _.merge({
16+
localPath: path.join(serverless.config.servicePath, '.dynamodb')
17+
},
18+
options
19+
);
1420
this.provider = "aws";
1521
this.commands = {
1622
dynamodb: {
@@ -191,7 +197,8 @@ class ServerlessDynamodbLocal {
191197
startHandler() {
192198
const config = this.service.custom && this.service.custom.dynamodb || {};
193199
const options = _.merge({
194-
sharedDb: this.options.sharedDb || true
200+
sharedDb: this.options.sharedDb || true,
201+
install_path: this.options.localPath
195202
},
196203
config && config.start,
197204
this.options

0 commit comments

Comments
 (0)