File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class ServerlessDynamodbLocal {
13
13
this . serverlessLog = serverless . cli . log . bind ( serverless . cli ) ;
14
14
this . config = this . service . custom && this . service . custom . dynamodb || { } ;
15
15
this . options = _ . merge ( {
16
- localPath : path . join ( serverless . config . servicePath , '.dynamodb' )
16
+ localPath : serverless . config && path . join ( serverless . config . servicePath , '.dynamodb' )
17
17
} ,
18
18
options
19
19
) ;
@@ -105,7 +105,7 @@ class ServerlessDynamodbLocal {
105
105
}
106
106
} ;
107
107
108
- const stage = this . options . stage || this . service . provider . stage ;
108
+ const stage = ( this . options && this . options . stage ) || ( this . service . provider && this . service . provider . stage ) ;
109
109
if ( this . config . stages && ! this . config . stages . includes ( stage ) ) {
110
110
// don't do anything for this stage
111
111
this . hooks = { } ;
@@ -206,6 +206,12 @@ class ServerlessDynamodbLocal {
206
206
207
207
// otherwise endHandler will be mis-informed
208
208
this . options = options ;
209
+
210
+ let dbPath = options . dbPath ;
211
+ if ( dbPath ) {
212
+ options . dbPath = path . isAbsolute ( dbPath ) ? dbPath : path . join ( this . serverless . config . servicePath , dbPath ) ;
213
+ }
214
+
209
215
if ( ! options . noStart ) {
210
216
dynamodbLocal . start ( options ) ;
211
217
}
You can’t perform that action at this time.
0 commit comments