Skip to content

Commit

Permalink
fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
cvila84 committed Jan 9, 2019
1 parent 6863e02 commit f5975f1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@ func CopyFile(src, dst string) error {
// CleanDir ...
func CleanDir(dirPath string) {
dir, err := ioutil.ReadDir(dirPath)
if err != nil {
panic(err)
}
for _, e := range dir {
err := os.RemoveAll(path.Join([]string{dirPath, e.Name()}...))
if err != nil {
panic(err)
if err == nil {
for _, e := range dir {
err := os.RemoveAll(path.Join([]string{dirPath, e.Name()}...))
if err != nil {
panic(err)
}
}
}
}
Expand Down

0 comments on commit f5975f1

Please sign in to comment.