@@ -167,7 +167,9 @@ func initInstance(client rpc.ArduinoCoreClient) *rpc.Instance {
167167 // the data folder.
168168 initRespStream , err := client .Init (context .Background (), & rpc.InitReq {
169169 Configuration : & rpc.Configuration {
170- DataDir : dataDir ,
170+ DataDir : dataDir ,
171+ SketchbookDir : filepath .Join (dataDir , "sketchbook" ),
172+ DownloadsDir : filepath .Join (dataDir , "staging" ),
171173 },
172174 })
173175 if err != nil {
@@ -368,11 +370,12 @@ func callBoardsDetails(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
368370}
369371
370372func callBoardAttach (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
373+ currDir , _ := os .Getwd ()
371374 boardattachresp , err := client .BoardAttach (context .Background (),
372375 & rpc.BoardAttachReq {
373376 Instance : instance ,
374377 BoardUri : "/dev/ttyACM0" ,
375- SketchPath : filepath .Join (dataDir , "hello.ino" ),
378+ SketchPath : filepath .Join (currDir , "hello.ino" ),
376379 })
377380
378381 if err != nil {
@@ -402,11 +405,12 @@ func callBoardAttach(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
402405}
403406
404407func callCompile (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
408+ currDir , _ := os .Getwd ()
405409 compRespStream , err := client .Compile (context .Background (),
406410 & rpc.CompileReq {
407411 Instance : instance ,
408412 Fqbn : "arduino:samd:mkr1000" ,
409- SketchPath : "hello.ino" ,
413+ SketchPath : filepath . Join ( currDir , "hello.ino" ) ,
410414 Verbose : true ,
411415 })
412416
@@ -440,11 +444,12 @@ func callCompile(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
440444}
441445
442446func callUpload (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
447+ currDir , _ := os .Getwd ()
443448 uplRespStream , err := client .Upload (context .Background (),
444449 & rpc.UploadReq {
445450 Instance : instance ,
446451 Fqbn : "arduino:samd:mkr1000" ,
447- SketchPath : "hello.ino" ,
452+ SketchPath : filepath . Join ( currDir , "hello.ino" ) ,
448453 Port : "/dev/ttyACM0" ,
449454 Verbose : true ,
450455 })
0 commit comments