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

Method GetHostWorkingDir

pkg/ddevapp/ddevapp.go:3756–3769  ·  view source on GitHub ↗

GetHostWorkingDir will determine the appropriate working directory for the service on the host side

(service string, dir string)

Source from the content-addressed store, hash-verified

3754
3755// GetHostWorkingDir will determine the appropriate working directory for the service on the host side
3756func (app *DdevApp) GetHostWorkingDir(service string, dir string) string {
3757 // We have a corresponding host working_dir for the "web" service only
3758 if service != "web" {
3759 return ""
3760 }
3761 if dir == "" && app.WorkingDir != nil {
3762 dir = app.WorkingDir[service]
3763 }
3764 containerWorkingDirPrefix := strings.TrimSuffix(app.GetAbsAppRoot(true), "/") + "/"
3765 if !strings.HasPrefix(dir, containerWorkingDirPrefix) {
3766 return ""
3767 }
3768 return filepath.Join(app.GetAbsAppRoot(false), strings.TrimPrefix(dir, containerWorkingDirPrefix))
3769}
3770
3771// GetMariaDBVolumeName returns the Docker volume name of the mariadb/database volume
3772// For historical reasons this isn't lowercased.

Callers 1

Calls 1

GetAbsAppRootMethod · 0.95

Tested by

no test coverage detected