mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-03 21:15:36 +02:00
Overwrite existing dest when copying symlink and preserve link target
This commit is contained in:
+6
-2
@@ -501,8 +501,12 @@ func CopySymlink(src, dest string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
linkDst := filepath.Join(dest, link)
|
||||
return os.Symlink(linkDst, dest)
|
||||
if FilepathExists(dest) {
|
||||
if err := os.RemoveAll(dest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return os.Symlink(link, dest)
|
||||
}
|
||||
|
||||
// CopyFile copies the file at src to dest
|
||||
|
||||
Reference in New Issue
Block a user