basho/rebar — pull request #210 by uwiger (2012-04-05 17:05:55+00:00)
Title: use file:script if a .config.script file present

This patch makes rebar look for a file named `rebar.config.script` before reading `rebar.config`. The main use of this would be to be able to "patch" the rebar config, based on the current environment.

If the .script file is present, rebar will process it using `file:script(File, [{'SCRIPT', File}])`. The .script file may in its turn process rebar.config and use it as a basis for customizations. Note that the variable `SCRIPT` is pre-bound to the name of the .script file.

The rebar_config module looks for the rebar.config.script file in the same location as the rebar.config. To be precise, it appends ".script" to the name of the config file that would otherwise be read. Thus, if rebar is called with `rebar --config /tmp/foo ...`, then rebar will try to read /tmp/foo.script first.