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

config file location #1

Closed
olegakbarov opened this issue Mar 1, 2016 · 5 comments
Closed

config file location #1

olegakbarov opened this issue Mar 1, 2016 · 5 comments
Labels

Comments

@olegakbarov
Copy link

It is somewhat tricky to tell Omniconf where to look for a configuration file.

could you please elaborate on that? I have a .edn file in root directory of the project and it doesn't seem to be parsed.

Relevant code:

(defn ring-init []
  (let [local-config "dev-config.edn"]
    (if (.exists (io/as-file local-config))
      (cfg/populate-from-file local-config)
      (log/warn "Can't find local dev configuration file" local-config))
    (init)))
@alexander-yakushev
Copy link
Contributor

@olegakbarov I referred to a situation when you want to specify the confg file dynamically rather than hardcode it. In the case of hardcoding there shouldn't be any problem.

In your case, it is weird that the file is not parsed. I assume you don't get a warning, and populate-from-file silently finishes without making any changes?

@olegakbarov
Copy link
Author

i got an following error:

ERROR: [:telegram-token] : Value must be provided.

ofcourse :telegram-token exists in dev-config.edn, so i'm confused

Problem solves when i add default value to (cfg/define ... )

@alexander-yakushev
Copy link
Contributor

Can you run (cfg/populate-from-file "dev-config.edn"), and then (cfg/report-configuration)? It will also help if you add another value into the file and see if it appears in the configuration. That way we'll see if the file is parsed at all.

@olegakbarov
Copy link
Author

I'm sorry, that's my code. Wrong order of initialization.

Thanks for help and good luck with awesome library!

@alexander-yakushev
Copy link
Contributor

Great to know, thank you!

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

No branches or pull requests

2 participants