diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-06-21 21:46:41 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-07-06 20:14:15 +0200 |
commit | 8263f12594c82edda1c5b80d2e9494fed925b423 (patch) | |
tree | 90318d1cf42fb24a0c9b73d0df33d212fbdec228 /src/rebar.erl | |
parent | 2d353f82a3b272c184aea0a1ece272f8ff4a1337 (diff) |
Add support for $HOME/.rebar/config
Diffstat (limited to 'src/rebar.erl')
-rw-r--r-- | src/rebar.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/rebar.erl b/src/rebar.erl index 7f33d4d..797f71a 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -98,8 +98,19 @@ run_aux(Commands) -> %% Keep track of how many operations we do, so we can detect bad commands erlang:put(operations, 0), + %% If $HOME/.rebar/config exists load and use as global config + GlobalConfigFile = filename:join(os:getenv("HOME"), ".rebar/config"), + GlobalConfig = case filelib:is_regular(GlobalConfigFile) of + true -> + ?DEBUG("Load global config file ~p~n", + [GlobalConfigFile]), + rebar_config:new(GlobalConfigFile); + false -> + rebar_config:new() + end, + %% Process each command, resetting any state between each one - rebar_core:process_commands(CommandAtoms). + rebar_core:process_commands(CommandAtoms, GlobalConfig). %% %% print help/usage string |