Skip to content

Commit

Permalink
Merge pull request #176 from ytsarev/clean-case-dir
Browse files Browse the repository at this point in the history
Clean case directory during preparation step
  • Loading branch information
ytsarev committed Jan 18, 2024
2 parents bde6d12 + 17b6df3 commit 6a53f0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ type preparer struct {
testDirectory string
}

//nolint:gocyclo // This function is not complex, gocyclo threshold was reached due to the error handling.
func (p *preparer) prepareManifests() ([]config.Manifest, error) {
caseDirectory := filepath.Join(p.testDirectory, caseDirectory)
if err := os.RemoveAll(caseDirectory); err != nil {
return nil, errors.Wrapf(err, "cannot clean directory %s", caseDirectory)
}
if err := os.MkdirAll(caseDirectory, os.ModePerm); err != nil {
return nil, errors.Wrapf(err, "cannot create directory %s", caseDirectory)
}
Expand Down

0 comments on commit 6a53f0c

Please sign in to comment.