Skip to content

Commit dfb3720

Browse files
committed
Made configs.Configuration.ArduinoDownloadsDir field public
1 parent 46d175e commit dfb3720

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

configs/configuration.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ type Configuration struct {
4242
// IsPortable is set to true if the cli lives in IDE directory and the IDE is portable
4343
IsPortable bool
4444

45-
// downloadsDir is the directory where the package files are downloaded and cached.
45+
// ArduinoDownloadsDir overrides the default directory where the package files are downloaded and cached.
4646
// Use DownloadsDir() method to retrieve it.
47-
downloadsDir *paths.Path
47+
ArduinoDownloadsDir *paths.Path
4848

4949
// IDEBundledCheckResult contains the result of the check to see if the CLI is bundled with the IDE:
5050
// the field is true if the CLI is bundled with the Arduino IDE, false if the CLI is running
@@ -101,8 +101,8 @@ func (config *Configuration) PackagesDir() *paths.Path {
101101

102102
// DownloadsDir returns the directory for archive downloads.
103103
func (config *Configuration) DownloadsDir() *paths.Path {
104-
if config.downloadsDir != nil {
105-
return config.downloadsDir
104+
if config.ArduinoDownloadsDir != nil {
105+
return config.ArduinoDownloadsDir
106106
}
107107
return config.DataDir.Join("staging")
108108
}

configs/env_vars_serializer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ func (config *Configuration) LoadFromEnv() {
3535
config.DataDir = paths.New(dir)
3636
}
3737
if dir, has := os.LookupEnv("ARDUINO_DOWNLOADS_DIR"); has {
38-
config.downloadsDir = paths.New(dir)
38+
config.ArduinoDownloadsDir = paths.New(dir)
3939
}
4040
}

configs/yaml_serializer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func (config *Configuration) LoadFromYAML(path *paths.Path) error {
6868
config.SketchbookDir = paths.New(ret.SketchbookPath)
6969
}
7070
if ret.ArduinoDownloadsDir != "" {
71-
config.downloadsDir = paths.New(ret.ArduinoDownloadsDir)
71+
config.ArduinoDownloadsDir = paths.New(ret.ArduinoDownloadsDir)
7272
} else {
73-
config.downloadsDir = nil
73+
config.ArduinoDownloadsDir = nil
7474
}
7575
if ret.ProxyType != "" {
7676
config.ProxyType = ret.ProxyType
@@ -102,8 +102,8 @@ func (config *Configuration) SerializeToYAML() ([]byte, error) {
102102
if config.DataDir != nil {
103103
c.ArduinoDataDir = config.DataDir.String()
104104
}
105-
if config.downloadsDir != nil {
106-
c.ArduinoDownloadsDir = config.downloadsDir.String()
105+
if config.ArduinoDownloadsDir != nil {
106+
c.ArduinoDownloadsDir = config.ArduinoDownloadsDir.String()
107107
}
108108
c.ProxyType = config.ProxyType
109109
if config.ProxyType == "manual" {

0 commit comments

Comments
 (0)