Skip to content

Dynamic configuration

tuncer edited this page Apr 18, 2012 · 4 revisions

In addition to rebar.config and reltool.config, you can make use of dynamic configuration
based on file:script/2.

If rebar.config.script or reltool.config.script exist, the script file
will be evaluated and the result used as configuration. It also works for custom
rebar.config files. That means rebar -C special_config will check for
existence of special_config.script.

For convenience two bindings (variables) are available in a script during evaluation:

  1. CONFIG - result of file:consult/1 if the script file being evaluated also exists
    without the .script extension. Otherwise, [].

  2. SCRIPT - filename of the script being evaluated

Clone this wiki locally