Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
01731605
Commit
01731605
authored
Feb 13, 2019
by
Matteo Suppo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return an error message when there's a old configuration file
parent
24533977
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
commands/root/root.go
commands/root/root.go
+7
-0
No files found.
commands/root/root.go
View file @
01731605
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment