From 1f8c8bd134c09c8dc74e96e26ad05c1193ac8afd Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Fri, 11 Dec 2020 23:22:29 +0100 Subject: [PATCH] Fix make parental dirs for symlinks on untar Signed-off-by: Matej Vasek --- local/local.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/local/local.go b/local/local.go index dbb08dab..2487e840 100644 --- a/local/local.go +++ b/local/local.go @@ -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 }