Commit 01731605 authored by Matteo Suppo's avatar Matteo Suppo

Return an error message when there's a old configuration file

parent 24533977
......@@ -18,6 +18,7 @@
package root
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
......@@ -116,6 +117,12 @@ func preRun(cmd *cobra.Command, args []string) {
// initConfigs initializes the configuration from the specified file.
func initConfigs() {
// Return error if an old configuration file is found
if paths.New(".cli-config.yml").Exist() {
logrus.Error("Old configuration file detected. Ensure you are using the new `arduino-cli.yaml` configuration")
formatter.PrintError(fmt.Errorf("old configuration file detected"), "Ensure you are using the new `arduino-cli.yaml` configuration")
os.Exit(commands.ErrGeneric)
}
// Start with default configuration
if conf, err := configs.NewConfiguration(); err != nil {
logrus.WithError(err).Error("Error creating default configuration")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment