Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
triole opened this issue Feb 12, 2025 · 3 comments
Closed

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

triole opened this issue Feb 12, 2025 · 3 comments
Assignees
Milestone

Comments

@triole
Copy link
Contributor

triole commented Feb 12, 2025

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.

@yottahmd
Copy link
Collaborator

Thank you very much for reporting the issue! It's actually a bug. Sorry for inconvenience. We'll release the fix very soon.

@yottahmd
Copy link
Collaborator

It’s fixed in the latest version. Let us know if you experience any issues.

@triole
Copy link
Contributor Author

triole commented Feb 15, 2025

Thanks for the fix. Works great now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants