Skip to content

Commit

Permalink
fix: restore to empty dir fails differently
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmarble committed Jan 11, 2020
1 parent ad500a9 commit a55f0aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/influxd/restore/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func restoreBolt() error {
}
defer f.Close()

if err := os.MkdirAll(filepath.Dir(flags.boltPath), 0777); err != nil {
return err
}
w, err := os.OpenFile(flags.boltPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
if err != nil && !os.IsNotExist(err) {
return err
Expand Down

0 comments on commit a55f0aa

Please sign in to comment.