File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ variable sets the `directories.user` configuration option.
7676On Linux or macOS, you can use the [ ` export ` command] [ export command ] to set environment variables. On Windows cmd, you
7777can use the [ ` set ` command] [ set command ] .
7878
79+ ` ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ` environment variables can be a list of space-separated URLs.
80+
7981#### Example
8082
8183Setting an additional Boards Manager URL using the ` ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ` environment variable:
@@ -84,6 +86,12 @@ Setting an additional Boards Manager URL using the `ARDUINO_BOARD_MANAGER_ADDITI
8486$ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/package_staging_index.json
8587```
8688
89+ Setting multiple additional Boards Manager URLs using the ` ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ` environment variable:
90+
91+ ``` sh
92+ $ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=" https://downloads.arduino.cc/packages/package_staging_index.json https://downloads.arduino.cc/packages/package_mbed_index.json"
93+ ```
94+
8795### Configuration file
8896
8997[ ` arduino-cli config init ` ] [ arduino-cli config init ] creates or updates a configuration file with the current
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package config
1717
1818import (
1919 "os"
20+ "strings"
2021
2122 "github.com/arduino/arduino-cli/configuration"
2223 "github.com/arduino/arduino-cli/internal/cli/arguments"
@@ -97,6 +98,13 @@ func runInitCommand(cmd *cobra.Command, args []string) {
9798 configuration .SetDefaults (newSettings )
9899 configuration .BindFlags (cmd , newSettings )
99100
101+ for _ , url := range newSettings .GetStringSlice ("board_manager.additional_urls" ) {
102+ if strings .Contains (url , "," ) {
103+ feedback .Fatal (tr ("Urls cannot contain commas. Separate multiple urls exported as env var with a space:\n %s" , url ),
104+ feedback .ErrGeneric )
105+ }
106+ }
107+
100108 if err := newSettings .WriteConfigAs (configFileAbsPath .String ()); err != nil {
101109 feedback .Fatal (tr ("Cannot create config file: %v" , err ), feedback .ErrGeneric )
102110 }
You can’t perform that action at this time.
0 commit comments