Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Use Exists in CreateAll
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBarendse committed Nov 25, 2019
1 parent d304a89 commit c632359
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/secrethub/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ func (s dirService) createAll(path string) error {
return nil
}

_, err := s.GetTree(path, 0, false)
if err != api.ErrDirNotFound {
// err might be nil
exists, err := s.Exists(path)
if err != nil {
return err
}
if exists {
return nil
}

err = s.createAll(secretpath.Parent(path))
if err != nil {
Expand Down

0 comments on commit c632359

Please sign in to comment.