[erlang-questions] starting an app with an app.config file
Motiejus Jakštys
desired.mta@REDACTED
Sun Oct 21 00:45:49 CEST 2012
On Sat, Oct 20, 2012 at 10:00 PM, Roberto Ostinelli <roberto@REDACTED> wrote:
> Hi,
>
> this isn't working. From the docs:
>
> load(AppDescr) -> ok | {error, Reason}
> load(AppDescr, Distributed) -> ok | {error, Reason}
>
> So application:load/2 actually is not reading from a config file.
>
> Any other ideas?
{ok, Config} = file:consult(File),
[application:set_env(myapp, K, V) | {K, V} <- Config].
Not tested.
Config might have to be [Config], you should try this out.
--
Motiejus Jakštys
More information about the erlang-questions
mailing list