diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2014-12-16 14:53:26 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2014-12-16 14:53:26 -0500 |
commit | b5500c7301eb6017d956b041daf4001d7b6cb3ff (patch) | |
tree | b698186b6cfe8d64c3a8951748f838a734932998 /src/rebar3.erl | |
parent | 0672fc45b797b9a496e5bf7797d2b7168f16ca42 (diff) | |
parent | 3998dfb049f8e48c4595b72913837a0b8095a0fe (diff) |
Merge pull request #56 from tsloughter/profile_deps
rewrite profiles
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r-- | src/rebar3.erl | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index f6a2b78..b325dc8 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -106,11 +106,11 @@ run_aux(State, GlobalPluginProviders, RawArgs) -> application:start(ssl), inets:start(), - State2 = case os:getenv("REBAR_DEFAULT_PROFILE") of + State2 = case os:getenv("REBAR_PROFILE") of false -> - rebar_state:current_profile(State, default); + State; Profile -> - State1 = rebar_state:current_profile(State, list_to_atom(Profile)), + State1 = rebar_state:apply_profiles(State, [list_to_atom(Profile)]), rebar_state:default(State1, rebar_state:opts(State1)) end, @@ -127,7 +127,7 @@ run_aux(State, GlobalPluginProviders, RawArgs) -> State5 = rebar_state:create_logic_providers(AllProviders, State4), {Task, Args} = parse_args(RawArgs), - rebar_core:process_command(rebar_state:command_args(State5, Args), list_to_atom(Task)). + rebar_core:process_command(rebar_state:command_args(State5, Args), Task). init_config() -> %% Initialize logging system @@ -143,7 +143,7 @@ init_config() -> Config1 = case rebar_config:consult_file(?LOCK_FILE) of [D] -> - [{locks, D} | Config]; + [{locks, D}, {{deps, default}, D} | Config]; _ -> Config end, @@ -177,10 +177,6 @@ init_config() -> %% Initialize vsn cache {PluginProviders, rebar_state:set(State1, vsn_cache, dict:new())}. -%% -%% Parse command line arguments using getopt and also filtering out any -%% key=value pairs. What's left is the list of commands to run -%% parse_args([]) -> parse_args(["help"]); parse_args([H | Rest]) when H =:= "-h" @@ -189,8 +185,8 @@ parse_args([H | Rest]) when H =:= "-h" parse_args([H | Rest]) when H =:= "-v" ; H =:= "--version" -> parse_args(["version" | Rest]); -parse_args([RawTask | RawRest]) -> - {RawTask, RawRest}. +parse_args([Task | RawRest]) -> + {list_to_atom(Task), RawRest}. set_options(State, {Options, NonOptArgs}) -> GlobalDefines = proplists:get_all_values(defines, Options), @@ -251,7 +247,6 @@ global_option_spec_list() -> [ %% {Name, ShortOpt, LongOpt, ArgSpec, HelpMsg} {help, $h, "help", undefined, "Print this help."}, - %{verbose, $v, "verbose", integer, "Verbosity level (-v, -vv)."}, {version, $V, "version", undefined, "Show version information."}, %{config, $C, "config", string, "Rebar config file to use."}, {task, undefined, undefined, string, "Task to run."} |