()
| 306 | } |
| 307 | |
| 308 | func (p *Provider) doFilesPullCommand() ([]string, error) { |
| 309 | destDir := filepath.Join(p.getDownloadDir(), "files") |
| 310 | _ = os.RemoveAll(destDir) |
| 311 | _ = os.MkdirAll(destDir, 0755) |
| 312 | |
| 313 | if p.FilesPullCommand.Command == "" { |
| 314 | if p.FilesImportCommand.Command == "" { |
| 315 | util.Warning("No files_pull_command provided, so skipping files pull") |
| 316 | } |
| 317 | return nil, nil |
| 318 | } |
| 319 | s := p.FilesPullCommand.Service |
| 320 | if s == "" { |
| 321 | s = "web" |
| 322 | } |
| 323 | |
| 324 | err := p.app.ExecOnHostOrService(s, p.injectedEnvironment()+"; "+p.FilesPullCommand.Command) |
| 325 | if err != nil { |
| 326 | return nil, fmt.Errorf("failed to exec %s on %s: %v", p.FilesPullCommand.Command, s, err) |
| 327 | } |
| 328 | |
| 329 | return []string{filepath.Join(p.getDownloadDir(), "files")}, nil |
| 330 | } |
| 331 | |
| 332 | // getDatabaseBackups retrieves database using `generic backup database`, then |
| 333 | // describe until it appears, then download it. |
no test coverage detected