Meta-copy-symlinks-new-actions-cache (#2337)

* meta: copy symlinks

* copy file (old style)

* copy files (new styles)

* avoid spelling error detection

* add error

* fix

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2024-05-29 02:12:32 +02:00
committed by GitHub
parent ecd7875c00
commit 4977ba910c
2 changed files with 101 additions and 39 deletions

View File

@@ -68,7 +68,7 @@ func (cc *CopyCollector) WriteFile(fpath string, fi fs.FileInfo, linkName string
if err := os.MkdirAll(filepath.Dir(fdestpath), 0o777); err != nil {
return err
}
if f == nil {
if linkName != "" {
return os.Symlink(linkName, fdestpath)
}
df, err := os.OpenFile(fdestpath, os.O_CREATE|os.O_WRONLY, fi.Mode())