@@ -136,10 +136,7 @@ func main() {
136
136
go loop ()
137
137
138
138
// SetupSystray is the main thread
139
- configDir , err := getDefaultArduinoCreateConfigDir ()
140
- if err != nil {
141
- log .Panicf ("Can't open defaul configuration dir: %s" , err )
142
- }
139
+ configDir := getDefaultConfigDir ()
143
140
Systray = systray.Systray {
144
141
Hibernate : * hibernate ,
145
142
Version : version + "-" + commit ,
@@ -201,7 +198,7 @@ func loop() {
201
198
src , _ := os .Executable ()
202
199
srcPath := paths .New (src ) // The path of the agent's binary
203
200
srcDir := srcPath .Parent () // The directory of the agent's binary
204
- agentDir , err := getDefaultArduinoCreateConfigDir ()
201
+ agentDir := getDefaultConfigDir ()
205
202
206
203
// Instantiate Tools
207
204
Tools = tools.Tools {
@@ -216,6 +213,7 @@ func loop() {
216
213
Tools .Init (requiredToolsAPILevel )
217
214
218
215
// Let's handle the config
216
+ configDir := getDefaultConfigDir ()
219
217
var configPath * paths.Path
220
218
221
219
// see if the env var is defined, if it is take the config from there, this will override the default path
@@ -225,7 +223,7 @@ func loop() {
225
223
log .Panicf ("config from env var %s does not exists" , envConfig )
226
224
}
227
225
log .Infof ("using config from env variable: %s" , configPath )
228
- } else if defaultConfigPath := agentDir .Join ("config.ini" ); defaultConfigPath .Exist () {
226
+ } else if defaultConfigPath := configDir .Join ("config.ini" ); defaultConfigPath .Exist () {
229
227
// by default take the config from the ~/.arduino-create/config.ini file
230
228
configPath = defaultConfigPath
231
229
log .Infof ("using config from default: %s" , configPath )
@@ -243,7 +241,7 @@ func loop() {
243
241
}
244
242
}
245
243
if configPath == nil {
246
- configPath = generateConfig (agentDir )
244
+ configPath = generateConfig (configDir )
247
245
}
248
246
249
247
// Parse the config.ini
0 commit comments