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?
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
leslie@msi:~$ arduino-cli sketch new mytest -v
INFO Using config file: /home/leslie/.arduino15/arduino-cli.yaml
INFO 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?
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:
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.
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.