-
-
Notifications
You must be signed in to change notification settings - Fork 422
Change the directory of the configuration files #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CLA assistant check
All committers have signed the CLA.
If you install the arduino cli, the default directory of the configuration file is the location of the executable This is not an ideal configuration for linux or windows With this commit the configuration file is searched in the default configuration folder for each system
I see that, on linux, the library searches in ~/.config/....
and /etc/xdg/...
.
~/.config/arduino15
may have been a valid alterantive if used from the beginning but since we used ~/.arduino15
to store everything I'd like to continue to use that one. Also /etc/xdg
seems a bit overkill to me, why the extra xdg
sub-folder? /etc/arduino-cli.conf
seems enough...
Let's implement here some ideas from: #30
To recap some points:
- We should look for a configuration in some predefined places, for example on Linux:
/etc/
~/.arduino15/
${pwd}
those directories are listed in increasing order of priority and any config file found should override the previous one (I mean the options defined in ${pwd}
should take priority on the ones in /etc
for example).
- we can navigate parent folders for
${pwd}
to search for a config file, this would allow to make a per-project configuration.
and this is added by me:
- we should consider a better future-proof name for the config file like:
arduino-cli.conf
so we have a nice/etc/arduino-cli.conf
instead of/etc/.cli-config.yaml
bxparks
commented
Jan 31, 2019
Do we need to worry about $arduino_ide_dir/portable
, as described in https://www.arduino.cc/en/Guide/PortableIDE ? I don't use ~/.arduino15
, because I keep multiple versions of the IDE around for testing, and I don't want one version of the IDE clobbering the files and configs of another version.
This function will navigate the filesystem scraping the fs searching for config files. It will search in $pwd navigating through parent folders stopping at $root
@bxparks we pushed forward portable support here: #123
Also we started bundling the cli in the official Beta IDE, at the moment arduino-cli
detects if it's bundled with the IDE and also if there is a portable folder:
~/Code/arduino/build/linux/work$ ls -l
total 29272
-rwxr-xr-x 1 cmaglie cmaglie 882 feb 1 10:05 arduino
-rwxr-xr-x 1 cmaglie cmaglie 13822120 feb 1 10:05 arduino-builder
-rwxr-xr-x 1 cmaglie cmaglie 16000485 feb 1 10:05 arduino-cli
-rwxr-xr-x 1 cmaglie cmaglie 5161 feb 1 10:05 arduino-linux-setup.sh
drwxr-xr-x 13 cmaglie cmaglie 4096 feb 1 10:05 examples
drwxr-xr-x 4 cmaglie cmaglie 4096 feb 1 10:05 hardware
-rwxr-xr-x 1 cmaglie cmaglie 9796 feb 1 10:05 install.sh
drwxr-xr-x 4 cmaglie cmaglie 4096 feb 1 10:05 lib
drwxr-xr-x 21 cmaglie cmaglie 4096 feb 1 10:05 libraries
drwxr-xr-x 6 cmaglie cmaglie 4096 feb 1 10:05 reference
-rw-r--r-- 1 cmaglie cmaglie 87826 feb 1 10:05 revisions.txt
drwxr-xr-x 4 cmaglie cmaglie 4096 feb 1 10:05 tools
drwxr-xr-x 4 cmaglie cmaglie 4096 gen 3 17:15 tools-builder
-rwxr-xr-x 1 cmaglie cmaglie 86 feb 1 10:05 uninstall.sh
~/Code/arduino/build/linux/work$ ./arduino-cli config dump
proxy_type: auto
sketchbook_path: /home/cmaglie/Workspace/sketchbook-cores-beta
arduino_data: /home/cmaglie/.arduino15
board_manager:
additional_urls:
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
~/Code/arduino/build/linux/work$ mkdir portable
~/Code/arduino/build/linux/work$ ./arduino-cli config dump
proxy_type: auto
sketchbook_path: /home/cmaglie/Code/arduino/build/linux/work/portable/sketchbook
arduino_data: /home/cmaglie/Code/arduino/build/linux/work/portable
board_manager: null
BTW we barely tested the "portable" scenario, (for example now I noticed the board_mager: null
in the config dump
) so it may require some more work.
It starts from the root and for every folder until $PWD it parses the yaml. Files closer to $PWD take precedence
This will make sure it can be chained with other ParseFromYaml
In this latest batch of commits I implemented the following:
we can navigate parent folders for
${pwd}
to search for a config file, this would allow to make a per-project configuration.
...' as last resource
Change the directory of the configuration files
...te-policy Default value for update policy and rate limit
Quote password in signing certificate import command
If you install the arduino cli, the default directory
of the configuration file is the location of the executable
This is not an ideal configuration for linux or windows
With this commit the configuration file is searched in the
default configuration folder for each system