@@ -142,8 +142,11 @@ func main() {
142
142
// Check if certificates made with Agent <=1.2.7 needs to be moved over the new location
143
143
cert .MigrateCertificatesGeneratedWithOldAgentVersions (config .GetCertificatesDir ())
144
144
145
+ configPath := config .GetConfigPath ()
146
+ fmt .Println ("configPath: " , configPath )
147
+
145
148
// Launch main loop in a goroutine
146
- go loop ()
149
+ go loop (configPath )
147
150
148
151
// SetupSystray is the main thread
149
152
configDir := config .GetDefaultConfigDir ()
@@ -156,6 +159,7 @@ func main() {
156
159
AdditionalConfig : * additionalConfig ,
157
160
ConfigDir : configDir ,
158
161
}
162
+ Systray .SetCurrentConfigFile (configPath )
159
163
160
164
if src , err := os .Executable (); err != nil {
161
165
panic (err )
@@ -166,11 +170,15 @@ func main() {
166
170
}
167
171
}
168
172
169
- func loop () {
173
+ func loop (configPath * paths. Path ) {
170
174
if * hibernate {
171
175
return
172
176
}
173
177
178
+ if configPath == nil {
179
+ log .Panic ("configPath is nil" )
180
+ }
181
+
174
182
log .SetLevel (log .InfoLevel )
175
183
log .SetOutput (os .Stdout )
176
184
@@ -189,10 +197,6 @@ func loop() {
189
197
h .broadcastSys <- mapB
190
198
}
191
199
192
- configPath := config .GetConfigPath ()
193
-
194
- fmt .Println ("configPath: " , configPath )
195
-
196
200
// if the default browser is Safari, prompt the user to install HTTPS certificates
197
201
// and eventually install them
198
202
if runtime .GOOS == "darwin" {
@@ -230,7 +234,6 @@ func loop() {
230
234
if err != nil {
231
235
log .Panicf ("cannot parse arguments: %s" , err )
232
236
}
233
- Systray .SetCurrentConfigFile (configPath )
234
237
235
238
// Parse additional ini config if defined
236
239
if len (* additionalConfig ) > 0 {
0 commit comments