DefaultWorkingDirMap returns the app type's default working directory map.
()
| 539 | |
| 540 | // DefaultWorkingDirMap returns the app type's default working directory map. |
| 541 | func (app *DdevApp) DefaultWorkingDirMap() map[string]string { |
| 542 | _, _, username := dockerutil.GetContainerUser() |
| 543 | // Default working directory values are defined here. |
| 544 | // Services working directories can be overridden by app types if needed. |
| 545 | defaults := map[string]string{ |
| 546 | "web": "/var/www/html/", |
| 547 | "db": "/home/" + username, |
| 548 | } |
| 549 | |
| 550 | if appFuncs, ok := appTypeMatrix[app.Type]; ok && appFuncs.defaultWorkingDirMap != nil { |
| 551 | return appFuncs.defaultWorkingDirMap(app, defaults) |
| 552 | } |
| 553 | |
| 554 | if app.Database.Type == nodeps.Postgres { |
| 555 | defaults["db"] = app.GetPostgresDataDir() |
| 556 | } |
| 557 | return defaults |
| 558 | } |
| 559 | |
| 560 | // docrootWorkingDir handles the shared case in which the web service working directory is the docroot. |
| 561 | func docrootWorkingDir(app *DdevApp, defaults map[string]string) map[string]string { |
no test coverage detected