Skip to content

Commit 1ab2f6c

Browse files
committed
Correct default sketchbook folder for macosx
1 parent f9b1332 commit 1ab2f6c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

configs/directories.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ func getDefaultSketchbookFolder() (string, error) {
126126
if err != nil {
127127
return "", fmt.Errorf("retrieving home dir: %s", err)
128128
}
129-
// TODO: before doing this, check IDE's preferences.txt for different sketchbook path
130-
return filepath.Join(usr.HomeDir, "Arduino"), nil
129+
130+
switch runtime.GOOS {
131+
case "linux":
132+
return filepath.Join(usr.HomeDir, "Arduino"), nil
133+
case "darwin":
134+
return filepath.Join(usr.HomeDir, "Documents", "Arduino"), nil
135+
case "windows":
136+
return "", fmt.Errorf("Windows temporarily unsupported")
137+
default:
138+
return "", fmt.Errorf("unsupported OS: %s", runtime.GOOS)
139+
}
131140
}

0 commit comments

Comments
 (0)