dispatchImportFilesAction executes the relevant import files workflow for each app type.
(uploadDir, importPath, extractPath string)
| 522 | |
| 523 | // dispatchImportFilesAction executes the relevant import files workflow for each app type. |
| 524 | func (app *DdevApp) dispatchImportFilesAction(uploadDir, importPath, extractPath string) error { |
| 525 | if strings.TrimSpace(uploadDir) == "" { |
| 526 | return fmt.Errorf("upload_dirs is not set for this project (%s)", app.Type) |
| 527 | } |
| 528 | |
| 529 | if appFuncs, ok := appTypeMatrix[app.Type]; ok { |
| 530 | // if a specific action is not defined, use a generic action |
| 531 | if appFuncs.importFilesAction == nil { |
| 532 | appFuncs.importFilesAction = genericImportFilesAction |
| 533 | } |
| 534 | return appFuncs.importFilesAction(app, uploadDir, importPath, extractPath) |
| 535 | } |
| 536 | |
| 537 | return fmt.Errorf("this project type (%s) does not support import-files", app.Type) |
| 538 | } |
| 539 | |
| 540 | // DefaultWorkingDirMap returns the app type's default working directory map. |
| 541 | func (app *DdevApp) DefaultWorkingDirMap() map[string]string { |