Skip to content

Commit 1f820d4

Browse files
committed
[osx] add tools folder to DYLD_LIBRARY_PATH
1 parent 22688b5 commit 1f820d4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

bin/osx/arduino101load

4.23 KB
Binary file not shown.

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"path/filepath"
11+
"runtime"
1112
"strings"
1213
"time"
1314
)
@@ -54,6 +55,13 @@ func main() {
5455
counter := 0
5556
board_found := false
5657

58+
if runtime.GOOS == "darwin" {
59+
library_path := os.Getenv("DYLD_LIBRARY_PATH")
60+
if !strings.Contains(library_path, bin_path) {
61+
os.Setenv("DYLD_LIBRARY_PATH", bin_path+":"+library_path)
62+
}
63+
}
64+
5765
for counter < 10 && board_found == false {
5866
PrintlnVerbose("Waiting for device...")
5967
out, err := sh.Command(dfu, dfu_flags, "-l").Output()

0 commit comments

Comments
 (0)