MCPcopy Index your code
hub / github.com/ddev/ddev / DefaultWorkingDirMap

Method DefaultWorkingDirMap

pkg/ddevapp/apptypes.go:541–558  ·  view source on GitHub ↗

DefaultWorkingDirMap returns the app type's default working directory map.

()

Source from the content-addressed store, hash-verified

539
540// DefaultWorkingDirMap returns the app type's default working directory map.
541func (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.
561func docrootWorkingDir(app *DdevApp, defaults map[string]string) map[string]string {

Callers 3

GetWorkingDirMethod · 0.95
WriteConfigMethod · 0.80
handleMainConfigArgsFunction · 0.80

Calls 2

GetPostgresDataDirMethod · 0.95
GetContainerUserFunction · 0.92

Tested by

no test coverage detected