Skip to content

Commit

Permalink
feat: enable go build script to handle symbolic link (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn authored Dec 25, 2024
1 parent d9223d0 commit 2475d63
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion core/src/ten_runtime/binding/go/tools/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,25 @@ func (ab *AppBuilder) autoDetectExtensions() error {
uniqueModules := make(map[string]string)

for _, entry := range entries {
if !entry.IsDir() {
var isDir bool

if entry.IsDir() {
isDir = true
} else if entry.Type()&os.ModeSymlink != 0 {
targetPath := path.Join(extBaseDir, entry.Name())
info, err := os.Stat(targetPath)
if err != nil {
if ab.options.Verbose {
log.Printf("Failed to stat %s: %v\n", targetPath, err)
}
continue
}
if info.IsDir() {
isDir = true
}
}

if !isDir {
continue
}

Expand Down

0 comments on commit 2475d63

Please sign in to comment.