File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 99 "os"
1010 "os/exec"
1111 "os/signal"
12+ "os/user"
13+ "path"
1214
1315 "github.com/arduino/arduino-language-server/ls"
1416 "github.com/arduino/arduino-language-server/streams"
@@ -75,6 +77,15 @@ func main() {
7577 log .Fatal ("ArduinoCLI daemon address and instance number must be set." )
7678 }
7779 } else {
80+ if * cliConfigPath == "" {
81+ if user , _ := user .Current (); user != nil {
82+ candidate := path .Join (user .HomeDir , ".arduino15/arduino-cli.yaml" )
83+ if _ , err := os .Stat (candidate ); err == nil {
84+ * cliConfigPath = candidate
85+ log .Printf ("ArduinoCLI config file found at %s\n " , candidate )
86+ }
87+ }
88+ }
7889 if * cliConfigPath == "" {
7990 log .Fatal ("Path to ArduinoCLI config file must be set." )
8091 }
You can’t perform that action at this time.
0 commit comments