File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,13 @@ func setDataDirectory() {
262
262
}
263
263
264
264
func buildConfig () {
265
- if _ , err := os .Stat ("hostd.yml" ); err == nil {
265
+ // write the config file
266
+ configPath := "hostd.yml"
267
+ if str := os .Getenv ("HOSTD_CONFIG_FILE" ); str != "" {
268
+ configPath = str
269
+ }
270
+
271
+ if _ , err := os .Stat (configPath ); err == nil {
266
272
if ! promptYesNo ("hostd.yml already exists. Would you like to overwrite it?" ) {
267
273
return
268
274
}
@@ -297,7 +303,7 @@ func buildConfig() {
297
303
setAdvancedConfig ()
298
304
299
305
// write the config file
300
- f , err := os .Create ("hostd.yml" )
306
+ f , err := os .Create (configPath )
301
307
if err != nil {
302
308
stdoutFatalError ("failed to create config file: " + err .Error ())
303
309
return
You can’t perform that action at this time.
0 commit comments