Skip to content

Commit

Permalink
Fix symlink builder to recursively walk the vendor directory
Browse files Browse the repository at this point in the history
  • Loading branch information
xhalo32 committed Aug 16, 2023
1 parent 3cbf3a5 commit 1ddc17b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions builder/symlink/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,8 @@ func populateVendorPath(vendorPath string, src string) {
innerSrc := filepath.Join(src, f.Name())
dst := filepath.Join(vendorPath, f.Name())
if err := os.Symlink(innerSrc, dst); err != nil {
// assume it's an existing directory, try to link the directory content instead.
// TODO should we do this recursively?
files, err := os.ReadDir(innerSrc)
if err != nil {
panic(err)
}
for _, f := range files {
srcFile := filepath.Join(innerSrc, f.Name())
dstFile := filepath.Join(dst, f.Name())
if err := os.Symlink(srcFile, dstFile); err != nil {
fmt.Println("ignoring symlink error", srcFile, dstFile)
}
}
fmt.Println("symlink error, trying", innerSrc, err)
populateVendorPath(dst, innerSrc);
}
}
}

0 comments on commit 1ddc17b

Please sign in to comment.