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

Method doFilesPullCommand

pkg/ddevapp/provider.go:308–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306}
307
308func (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.

Callers 1

GetBackupMethod · 0.95

Calls 5

getDownloadDirMethod · 0.95
injectedEnvironmentMethod · 0.95
WarningFunction · 0.92
ExecOnHostOrServiceMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected