Skip to content

[bug] config file not read when passed by cli arg #831

Closed
@triole

Description

I am not sure why nobody has this reported yet. Maybe I'm just making a very stupid mistake, but when I try to pass the cli arg --config the config file is not read. I had a quick look into the code but I do not have any knowledge about the viper library that does the cli arg stuff.

  1. Here is what I quicky tested in the cmd/main.go from line 43 on.
cobra.OnInitialize(func() {
		if cfgFile != "" {
			viper.SetConfigFile(cfgFile)
		}
		fmt.Printf("+++ %+v\n", viper.ConfigFileUsed())
	})
	fmt.Printf("___ %+v\n", viper.ConfigFileUsed())
}
  1. I ran it with the argument --config /home/usr/conf.yaml.
  2. My output was:
___
+++ /home/usr/conf.yaml

So it seems that dagu does not read the --config arg somehow. I also tried the latest version 1.16.1 and nothing happens when you try to pass the --config argument.

I tried dagu start-all --config /home/usr/config.yaml but dagu just does not seem to care.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions