[erlang-questions] starting an app with an app.config file

Phillip Toland phil.toland@REDACTED
Mon Oct 22 20:36:49 CEST 2012


If you put an app.config file into the test directory, rebar will pick
it up. If you don't want to have two app.config files, then you can
use the ct_extra_params option in rebar.config. The value of that
option will be passed on the command line of the beam process that
runs the tests, so you could pass in something like "-config
app.config" and have it use the existing config file.

~p


On Sat, Oct 20, 2012 at 7:00 PM, Roberto Ostinelli <roberto@REDACTED> wrote:
> Hi Motiejus,
>
> I'm doing something similar. It just feels weird. (:
>
> r.
>
> On Sat, Oct 20, 2012 at 3:45 PM, Motiejus Jakštys <desired.mta@REDACTED>
> wrote:
>>
>> 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
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
~p



More information about the erlang-questions mailing list