@@ -167,7 +167,9 @@ func initInstance(client rpc.ArduinoCoreClient) *rpc.Instance {
167
167
// the data folder.
168
168
initRespStream , err := client .Init (context .Background (), & rpc.InitReq {
169
169
Configuration : & rpc.Configuration {
170
- DataDir : dataDir ,
170
+ DataDir : dataDir ,
171
+ SketchbookDir : filepath .Join (dataDir , "sketchbook" ),
172
+ DownloadsDir : filepath .Join (dataDir , "staging" ),
171
173
},
172
174
})
173
175
if err != nil {
@@ -368,11 +370,12 @@ func callBoardsDetails(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
368
370
}
369
371
370
372
func callBoardAttach (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
373
+ currDir , _ := os .Getwd ()
371
374
boardattachresp , err := client .BoardAttach (context .Background (),
372
375
& rpc.BoardAttachReq {
373
376
Instance : instance ,
374
377
BoardUri : "/dev/ttyACM0" ,
375
- SketchPath : filepath .Join (dataDir , "hello.ino" ),
378
+ SketchPath : filepath .Join (currDir , "hello.ino" ),
376
379
})
377
380
378
381
if err != nil {
@@ -402,11 +405,12 @@ func callBoardAttach(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
402
405
}
403
406
404
407
func callCompile (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
408
+ currDir , _ := os .Getwd ()
405
409
compRespStream , err := client .Compile (context .Background (),
406
410
& rpc.CompileReq {
407
411
Instance : instance ,
408
412
Fqbn : "arduino:samd:mkr1000" ,
409
- SketchPath : "hello.ino" ,
413
+ SketchPath : filepath . Join ( currDir , "hello.ino" ) ,
410
414
Verbose : true ,
411
415
})
412
416
@@ -440,11 +444,12 @@ func callCompile(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
440
444
}
441
445
442
446
func callUpload (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
447
+ currDir , _ := os .Getwd ()
443
448
uplRespStream , err := client .Upload (context .Background (),
444
449
& rpc.UploadReq {
445
450
Instance : instance ,
446
451
Fqbn : "arduino:samd:mkr1000" ,
447
- SketchPath : "hello.ino" ,
452
+ SketchPath : filepath . Join ( currDir , "hello.ino" ) ,
448
453
Port : "/dev/ttyACM0" ,
449
454
Verbose : true ,
450
455
})
0 commit comments