Skip to content

Commit 79025dd

Browse files
committed
fix open303 search
1 parent 9e82364 commit 79025dd

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

internal/supercollider/supercollider.go

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -626,16 +626,33 @@ func hasOpen303() bool {
626626
return false
627627
}
628628

629-
// Check for the Open303 executable
630-
var execName string
631-
if runtime.GOOS == "windows" {
632-
execName = "Open303.exe"
633-
} else {
634-
execName = "Open303"
635-
}
629+
// Check for Open303.sc file recursively in the Extensions directory
630+
extensionDirs := getSuperColliderExtensionDirs()
636631

637-
execPath := filepath.Join(installDir, execName)
638-
return fileExists(execPath)
632+
for _, dir := range extensionDirs {
633+
// Check direct file path
634+
if fileExists(filepath.Join(dir, "Open303.sc")) {
635+
return true
636+
}
637+
638+
// Check in subdirectories recursively
639+
found := false
640+
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
641+
if err != nil {
642+
return nil
643+
}
644+
if !info.IsDir() && info.Name() == "Open303.sc" {
645+
found = true
646+
return filepath.SkipDir
647+
}
648+
return nil
649+
})
650+
651+
if found {
652+
return true
653+
}
654+
}
655+
return false
639656
}
640657

641658
func getLocalExtensionDir() string {

0 commit comments

Comments
 (0)