浏览代码

REBAR_CONFIG impacts file project root only

pull/1497/head
Fred Hebert 8 年前
父节点
当前提交
0bc0aeba9c
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. +1
    -1
      src/rebar3.erl
  2. +5
    -5
      src/rebar_config.erl

+ 1
- 1
src/rebar3.erl 查看文件

@ -176,7 +176,7 @@ init_config() ->
Verbosity = log_level(), Verbosity = log_level(),
ok = rebar_log:init(command_line, Verbosity), ok = rebar_log:init(command_line, Verbosity),
Config = rebar_config:consult(),
Config = rebar_config:consult_root(),
Config1 = rebar_config:merge_locks(Config, rebar_config:consult_lock_file(?LOCK_FILE)), Config1 = rebar_config:merge_locks(Config, rebar_config:consult_lock_file(?LOCK_FILE)),
%% If $HOME/.config/rebar3/rebar.config exists load and use as global config %% If $HOME/.config/rebar3/rebar.config exists load and use as global config

+ 5
- 5
src/rebar_config.erl 查看文件

@ -26,7 +26,7 @@
%% ------------------------------------------------------------------- %% -------------------------------------------------------------------
-module(rebar_config). -module(rebar_config).
-export([consult/0
-export([consult_root/0
,consult/1 ,consult/1
,consult_app_file/1 ,consult_app_file/1
,consult_file/1 ,consult_file/1
@ -46,15 +46,15 @@
%% Public API %% Public API
%% =================================================================== %% ===================================================================
%% @doc reads the default config file.
-spec consult() -> [any()].
consult() ->
%% @doc reads the default config file at the top of a full project
-spec consult_root() -> [any()].
consult_root() ->
consult_file(config_file()). consult_file(config_file()).
%% @doc reads the default config file in a given directory. %% @doc reads the default config file in a given directory.
-spec consult(file:name()) -> [any()]. -spec consult(file:name()) -> [any()].
consult(Dir) -> consult(Dir) ->
consult_file(filename:join(Dir, config_file())).
consult_file(filename:join(Dir, ?DEFAULT_CONFIG_FILE)).
%% @doc reads a given app file, including the `.script' variations, %% @doc reads a given app file, including the `.script' variations,
%% if any can be found. %% if any can be found.

正在加载...
取消
保存