File tree 2 files changed +16
-0
lines changed
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.
76
76
On Linux or macOS, you can use the [ ` export ` command] [ export command ] to set environment variables. On Windows cmd, you
77
77
can use the [ ` set ` command] [ set command ] .
78
78
79
+ ` ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ` environment variables can be a list of space-separated URLs.
80
+
79
81
#### Example
80
82
81
83
Setting 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
84
86
$ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/package_staging_index.json
85
87
```
86
88
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
+
87
95
### Configuration file
88
96
89
97
[ ` 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
17
17
18
18
import (
19
19
"os"
20
+ "strings"
20
21
21
22
"github.com/arduino/arduino-cli/configuration"
22
23
"github.com/arduino/arduino-cli/internal/cli/arguments"
@@ -97,6 +98,13 @@ func runInitCommand(cmd *cobra.Command, args []string) {
97
98
configuration .SetDefaults (newSettings )
98
99
configuration .BindFlags (cmd , newSettings )
99
100
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
+
100
108
if err := newSettings .WriteConfigAs (configFileAbsPath .String ()); err != nil {
101
109
feedback .Fatal (tr ("Cannot create config file: %v" , err ), feedback .ErrGeneric )
102
110
}
You can’t perform that action at this time.
0 commit comments