@@ -137,10 +137,7 @@ func initConfigs() {
137
137
138
138
// Read configuration from global config file
139
139
if commands .Config .ConfigFile .Exist () {
140
- logrus .Infof ("Reading configuration from %s" , commands .Config .ConfigFile )
141
- if err := commands .Config .LoadFromYAML (commands .Config .ConfigFile ); err != nil {
142
- logrus .WithError (err ).Warnf ("Could not read configuration from %s" , commands .Config .ConfigFile )
143
- }
140
+ readConfigFrom (commands .Config .ConfigFile )
144
141
}
145
142
146
143
if commands .Config .IsBundledInDesktopIDE () {
@@ -166,11 +163,15 @@ func initConfigs() {
166
163
// Read configuration from user specified file
167
164
if yamlConfigFile != "" {
168
165
commands .Config .ConfigFile = paths .New (yamlConfigFile )
169
- logrus .Infof ("Reading configuration from %s" , commands .Config .ConfigFile )
170
- if err := commands .Config .LoadFromYAML (commands .Config .ConfigFile ); err != nil {
171
- logrus .WithError (err ).Warnf ("Could not read configuration from %s" , commands .Config .ConfigFile )
172
- }
166
+ readConfigFrom (commands .Config .ConfigFile )
173
167
}
174
168
175
169
logrus .Info ("Configuration set" )
176
170
}
171
+
172
+ func readConfigFrom (path * paths.Path ) {
173
+ logrus .Infof ("Reading configuration from %s" , path )
174
+ if err := commands .Config .LoadFromYAML (path ); err != nil {
175
+ logrus .WithError (err ).Warnf ("Could not read configuration from %s" , path )
176
+ }
177
+ }
0 commit comments