Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit fe00e70

Browse files
authored
Merge pull request #51 from arduino/ignore-system-studio
ignore system studio when setting LD_LIBRARY_PATH
2 parents 9d00e14 + 6f11834 commit fe00e70

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package main
2121
import (
2222
"os"
2323
"path/filepath"
24+
"regexp"
2425
"strings"
2526
)
2627

@@ -30,7 +31,12 @@ func addIntelLibrariesToLdPath() {
3031
//scan /opt/intel searching for sdks
3132
var extraPaths []string
3233
filepath.Walk("/opt/intel", func(path string, f os.FileInfo, err error) error {
33-
if strings.Contains(f.Name(), ".so") && !strings.Contains(path, "uninstall") {
34+
libs := strings.Split(filepath.Dir(path), "/")
35+
if len(libs) > 3 {
36+
libs[3] = strings.ToLower(libs[3])
37+
}
38+
regex := regexp.MustCompile(".*system.*studio.*")
39+
if strings.Contains(f.Name(), ".so") && !strings.Contains(path, "uninstall") && !regex.MatchString(libs[3]) {
3440
extraPaths = appendIfUnique(extraPaths, filepath.Dir(path))
3541
}
3642
return nil

0 commit comments

Comments
 (0)