Skip to content

Commit 89715b0

Browse files
committed
Create parent folder for files in archives
1 parent 570005a commit 89715b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/download.go

+5
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ func extractTarGz(body []byte, location string) (string, error) {
419419
path := filepath.Join(location, strings.Replace(header.Name, basedir, "", -1))
420420
info := header.FileInfo()
421421

422+
// Create parent folder
423+
if err = os.MkdirAll(filepath.Dir(path), info.Mode()); err != nil {
424+
return location, err
425+
}
426+
422427
if info.IsDir() {
423428
if err = os.MkdirAll(path, info.Mode()); err != nil {
424429
return location, err

0 commit comments

Comments
 (0)