@@ -116,16 +116,6 @@ func preRun(cmd *cobra.Command, args []string) {
116
116
117
117
// initConfigs initializes the configuration from the specified file.
118
118
func initConfigs () {
119
- // Return error if an old configuration file is found
120
- if old := paths .New (".cli-config.yml" ); old .Exist () {
121
- logrus .Errorf ("Old configuration file detected: %s." , old )
122
- logrus .Info ("The name of this file has been changed to `arduino-cli.yaml`, please rename the file fix it." )
123
- formatter .PrintError (
124
- fmt .Errorf ("old configuration file detected: %s" , old ),
125
- "The name of this file has been changed to `arduino-cli.yaml`, please rename the file fix it." )
126
- os .Exit (commands .ErrGeneric )
127
- }
128
-
129
119
// Start with default configuration
130
120
if conf , err := configs .NewConfiguration (); err != nil {
131
121
logrus .WithError (err ).Error ("Error creating default configuration" )
@@ -160,6 +150,17 @@ func initConfigs() {
160
150
commands .Config .Navigate ("/" , pwd .String ())
161
151
}
162
152
153
+ // Read configuration from old configuration file if found, but output a warning.
154
+ if old := paths .New (".cli-config.yml" ); old .Exist () {
155
+ logrus .Errorf ("Old configuration file detected: %s." , old )
156
+ logrus .Info ("The name of this file has been changed to `arduino-cli.yaml`, please rename the file fix it." )
157
+ formatter .PrintError (
158
+ fmt .Errorf ("WARNING: Old configuration file detected: %s" , old ),
159
+ "The name of this file has been changed to `arduino-cli.yaml`, in a future release we will not support" +
160
+ "the old name `.cli-config.yml` anymore. Please rename the file to `arduino-cli.yaml` to silence this warning." )
161
+ readConfigFrom (old )
162
+ }
163
+
163
164
// Read configuration from environment vars
164
165
commands .Config .LoadFromEnv ()
165
166
0 commit comments