Go Down

Topic: user directory in config ignored  (Read 510 times) previous topic - next topic


At this time I'm using arduino-mk on my linux-box to compile/upload (simple) sketches.
Now trying to switch to arduino-cli ...
Am I doing something wrong or is this a bug?

leslie@msi:~$arduino-cli version
arduino-cli Version: 0.13.0 Commit: 693a045

leslie@msi:~$ arduino-cli config init
Config file written to: /home/leslie/.arduino15/arduino-cli.yaml

leslie@msi:~$ arduino-cli config dump
  additional_urls: []
  port: "50051"
  data: /home/leslie/.arduino15
  downloads: /home/leslie/.arduino15/staging
  user: /home/leslie/Arduino
  file: ""
  format: text
  level: info
  addr: :9090
  enabled: true

leslie@msi:~$ arduino-cli sketch new mytest -v
INFO[0000] Using config file: /home/leslie/.arduino15/arduino-cli.yaml
INFO[0000] arduino-cli version 0.13.0                  
Sketch created in: /home/leslie/mytest

Even after manually creating the directory /home/leslie/Arduino, arduino-cli creates the new sketches in my home directory. :'(

Can someone help me?

Kind regards


Hi Leslie

Unless you provide an absolute path, `arduino-cli sketch new` creates the sketch relative to the current directory. So this is the expected result.

You would need to provide the full path to the user directory to get your desired results:
Code: [Select]
arduino-cli sketch new /home/leslie/Arduino/mytest

I believe that a long time ago Arduino CLI did default to creating sketches in the user directory. It's possible there is some documentation that hasn't been updated since that time. Did you read something that made you expect this behavior? If so, please provide a link to it and I'll see if I can get it updated.


Hi Pert,
Thanks you for your quick reply.
I wrongly assumed that a sketch would be created or looked up in the configured user directory, regardless of your  "working directory" shown with pwd. It seems only the libraries subfolder is used by arduino-cli.

The documentation of "arduino-cli compile" shows indeed an example of an absolute path.
Perhaps the same example in "arduino-cli sketch new" might be usefull.

directories - directories used by Arduino CLI.
   user - the equivalent of the Arduino IDE's "sketchbook" directory. Library Manager installations are made to the libraries subdirectory of the user directory.

Kind regards

Go Up