Skip to content

Commit

Permalink
fix: getDatabaseBackups should check error on .downloads deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed May 2, 2024
1 parent 3a821f3 commit f028a22
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/ddevapp/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,14 @@ func (p *Provider) doFilesPullCommand() (filename []string, error error) {
// getDatabaseBackups retrieves database using `generic backup database`, then
// describe until it appears, then download it.
func (p *Provider) getDatabaseBackups() (filename []string, error error) {
_ = os.RemoveAll(p.getDownloadDir())
_ = os.Mkdir(p.getDownloadDir(), 0755)
err := os.RemoveAll(p.getDownloadDir())
if err != nil {
return nil, err
}
err = os.Mkdir(p.getDownloadDir(), 0755)
if err != nil {
return nil, err
}

if p.DBPullCommand.Command == "" {
return nil, nil
Expand All @@ -336,7 +342,7 @@ func (p *Provider) getDatabaseBackups() (filename []string, error error) {
if s == "" {
s = "web"
}
err := p.app.MutagenSyncFlush()
err = p.app.MutagenSyncFlush()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f028a22

Please sign in to comment.