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 {
1313 this . serverlessLog = serverless . cli . log . bind ( serverless . cli ) ;
1414 this . config = this . service . custom && this . service . custom . dynamodb || { } ;
1515 this . options = _ . merge ( {
16- localPath : path . join ( serverless . config . servicePath , '.dynamodb' )
16+ localPath : serverless . config && path . join ( serverless . config . servicePath , '.dynamodb' )
1717 } ,
1818 options
1919 ) ;
@@ -105,7 +105,7 @@ class ServerlessDynamodbLocal {
105105 }
106106 } ;
107107
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 ) ;
109109 if ( this . config . stages && ! this . config . stages . includes ( stage ) ) {
110110 // don't do anything for this stage
111111 this . hooks = { } ;
@@ -206,6 +206,12 @@ class ServerlessDynamodbLocal {
206206
207207 // otherwise endHandler will be mis-informed
208208 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+
209215 if ( ! options . noStart ) {
210216 dynamodbLocal . start ( options ) ;
211217 }
You can’t perform that action at this time.
0 commit comments