File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,18 @@ func (flags *Flags) Parse() {
161
161
return
162
162
}
163
163
164
- // If no config file is explicitly passed in as a param then set the flag to the default config file
164
+ // If no config file is explicitly passed in as a param
165
+ // then try the `WTF_CONFIG` environment variable
166
+ // then fallback to the default config file to define the default flag value
165
167
configDir , err := cfg .WtfConfigDir ()
166
168
if err != nil {
167
169
fmt .Printf ("Error: %v\n " , err )
168
170
os .Exit (1 )
169
171
}
170
- flags .Config = filepath .Join (configDir , "config.yml" )
172
+ envCfg := os .Getenv ("WTF_CONFIG" )
173
+ if envCfg == "" {
174
+ flags .Config = envCfg
175
+ } else {
176
+ flags .Config = filepath .Join (configDir , "config.yml" )
177
+ }
171
178
}
You can’t perform that action at this time.
0 commit comments