diff options
author | Anders <andersk84@gmail.com> | 2010-10-25 13:48:57 +0100 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-11-09 20:19:38 -0700 |
commit | 513ae33c5c5f67a72d6149ecef6968b634cad846 (patch) | |
tree | d81a2a026ed7c97bde0568cf70cce1c7b40a1706 /src/rebar_config.erl | |
parent | c604d85ed56363ee1a0de1f28dd1db40d27ff406 (diff) |
Add possibility to specify rebar config for the "main" application
Diffstat (limited to 'src/rebar_config.erl')
-rw-r--r-- | src/rebar_config.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rebar_config.erl b/src/rebar_config.erl index ccabed0..cba0e64 100644 --- a/src/rebar_config.erl +++ b/src/rebar_config.erl @@ -45,9 +45,19 @@ new() -> opts = []}. new(ParentConfig) -> + %% If we are at the top level we might want to load another rebar.config + %% We can be certain that we are at the top level if we don't have any + %% configs yet since if we are at another level we must have some config. + ConfName = case ParentConfig of + {config, _, []} -> + rebar_config:get_global(config, "rebar.config"); + _ -> + "rebar.config" + end, + %% Load terms from rebar.config, if it exists Dir = rebar_utils:get_cwd(), - ConfigFile = filename:join([Dir, "rebar.config"]), + ConfigFile = filename:join([Dir, ConfName]), case file:consult(ConfigFile) of {ok, Terms} -> %% Found a config file with some terms. We need to be able to |