Skip to content

Commit

Permalink
Merge pull request #83 from matejvasek/fix-tar-symlinks
Browse files Browse the repository at this point in the history
Fix make parental dirs for symlinks on untar
  • Loading branch information
ekcasey authored Dec 11, 2020
2 parents 339e186 + 1f8c8bd commit 8581300
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 8581300

Please sign in to comment.