mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-05 01:59:08 +00:00
Merge pull request #121 from niklashhh/fix-recursive-symlinker
Fix symlink builder to recursively walk the vendor directory
This commit is contained in:
commit
31b6d2e40b
1 changed files with 2 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue