Skip to content

Commit

Permalink
Fix make parental dirs for symlinks on untar
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Dec 11, 2020
1 parent 339e186 commit 1f8c8bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,13 @@ func untar(r io.Reader, dest string) error {
}
fh.Close()
case tar.TypeSymlink:
_, err := os.Stat(filepath.Dir(path))
if os.IsNotExist(err) {
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
return err
}
}

if err := os.Symlink(hdr.Linkname, path); err != nil {
return err
}
Expand Down

0 comments on commit 1f8c8bd

Please sign in to comment.