Skip to content

Commit

Permalink
fix: fix creating subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
Phelan164 committed Feb 26, 2023
1 parent 0165f19 commit 105a11a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/util/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func Unzip(fPath string, dstDir string, owner string, uploadedModel *datamodel.M
return "", "", err
}
// ensure the parent folder existed
if _, err := os.Stat(filepath.Base(fPath)); os.IsNotExist(err) {
if err := os.MkdirAll(filepath.Base(fPath), os.ModePerm); err != nil {
if _, err := os.Stat(filepath.Dir(fPath)); os.IsNotExist(err) {
if err := os.MkdirAll(filepath.Dir(fPath), os.ModePerm); err != nil {
return "", "", err
}
}
Expand Down

0 comments on commit 105a11a

Please sign in to comment.