GetHostWorkingDir will determine the appropriate working directory for the service on the host side
(service string, dir string)
| 3754 | |
| 3755 | // GetHostWorkingDir will determine the appropriate working directory for the service on the host side |
| 3756 | func (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. |
no test coverage detected