Skip to content

Change the directory of the configuration files #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7112bc2
Change the directory of the configuration files
matteosuppo Jan 31, 2019
f5d7eae
Stub new function configs.Navigate
matteosuppo Feb 1, 2019
4a73a8e
Navigate returns the default configuration
matteosuppo Feb 11, 2019
74f9f6a
Search for config file in local directory
matteosuppo Feb 11, 2019
f785e1c
Inherit configuration from parent folders
matteosuppo Feb 11, 2019
4712662
Make Navigate a method of Configuration
matteosuppo Feb 11, 2019
da73a11
Use config.Navigate in command root
matteosuppo Feb 11, 2019
5e22ab2
Forgot deps
matteosuppo Feb 11, 2019
8f0150b
Fix bugs in tests
matteosuppo Feb 11, 2019
5f9cff0
Read default config file (in .arduino15)
matteosuppo Feb 13, 2019
8659dd2
Rename configuration file
matteosuppo Feb 13, 2019
f9bf3a8
Remove configdir
matteosuppo Feb 13, 2019
392f7cf
Consistent usage of paths helper
matteosuppo Feb 13, 2019
b2e6f47
Add license where missing
matteosuppo Feb 13, 2019
11be6bd
Don't show the default package index
matteosuppo Feb 13, 2019
930b89a
Make linter happy
matteosuppo Feb 13, 2019
2453397
Fix navigate tests
matteosuppo Feb 13, 2019
0173160
Return an error message when there's a old configuration file
matteosuppo Feb 13, 2019
4705594
Fix path of default config
matteosuppo Feb 13, 2019
6145d74
Correct order of preferences loading. Added more logging.
cmaglie Feb 14, 2019
3d25175
Updated go-paths-helper
cmaglie Feb 14, 2019
5c48c84
Correctly handle error when looking for configuration on parent folders
cmaglie Feb 14, 2019
66ce6f8
configs: Correctly override board manager additional urls
cmaglie Feb 14, 2019
de5ac23
UploadsTests: go back to previous working directory after test
cmaglie Feb 14, 2019
ebb0de9
Refactored duplicated code
cmaglie Feb 14, 2019
fc64888
configs: if cwd could not be determined try to open 'arduino-cli.yaml…
cmaglie Feb 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
configs: Correctly override board manager additional urls
  • Loading branch information
cmaglie committed Feb 14, 2019
commit 66ce6f84e146a5f8232a9bbe5e9190cc6f03492c
11 changes: 10 additions & 1 deletion commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ func executeWithArgs(t *testing.T, args ...string) (int, []byte) {

// This closure is here because we won't that the defer are executed after the end of the "executeWithArgs" method
func() {
// Create an empty config for the CLI test
conf := paths.New("arduino-cli.yaml")
require.False(t, conf.Exist())
err := conf.WriteFile([]byte("board_manager:\n additional_urls:\n"))
require.NoError(t, err)
defer func() {
require.NoError(t, conf.Remove())
}()

redirect := &stdOutRedirect{}
redirect.Open(t)
defer func() {
Expand Down Expand Up @@ -544,7 +553,7 @@ func TestInvalidCoreURL(t *testing.T) {
require.NoError(t, err, "making temporary dir")
defer tmp.RemoveAll()

configFile := tmp.Join("cli-config.yml")
configFile := tmp.Join("arduino-cli.yaml")
configFile.WriteFile([]byte(`
board_manager:
additional_urls:
Expand Down
3 changes: 3 additions & 0 deletions configs/yaml_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (config *Configuration) LoadFromYAML(path *paths.Path) error {
}
}
if ret.BoardsManager != nil {
if len(config.BoardManagerAdditionalUrls) > 1 {
config.BoardManagerAdditionalUrls = config.BoardManagerAdditionalUrls[:1]
}
for _, rawurl := range ret.BoardsManager.AdditionalURLS {
url, err := url.Parse(rawurl)
if err != nil {
Expand Down