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

Method UploadFiles

pkg/ddevapp/provider.go:274–292  ·  view source on GitHub ↗

UploadFiles is used by Push to push the user-generated files to the hosting provider

()

Source from the content-addressed store, hash-verified

272
273// UploadFiles is used by Push to push the user-generated files to the hosting provider
274func (p *Provider) UploadFiles() error {
275 _ = os.RemoveAll(p.getDownloadDir())
276 _ = os.Mkdir(p.getDownloadDir(), 0755)
277
278 if p.FilesPushCommand.Command == "" {
279 util.Warning("No files_push_command provided, so skipping files push")
280 return nil
281 }
282
283 s := p.FilesPushCommand.Service
284 if s == "" {
285 s = "web"
286 }
287 err := p.app.ExecOnHostOrService(s, p.injectedEnvironment()+"; "+p.FilesPushCommand.Command)
288 if err != nil {
289 return fmt.Errorf("failed to exec %s on %s: %v", p.FilesPushCommand.Command, s, err)
290 }
291 return nil
292}
293
294// prepDownloadDir ensures the download cache directories are created and writeable.
295func (p *Provider) prepDownloadDir() {

Callers 1

PushMethod · 0.80

Calls 5

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

Tested by

no test coverage detected