浏览代码

Merge pull request #2295 from ferd/support-mix-env-outdir

Support ENV var for mix in the bare compiler
pull/2296/head
Fred Hebert 5 年前
提交者 GitHub
父节点
当前提交
e33916734d
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      src/rebar_prv_bare_compile.erl

+ 5
- 1
src/rebar_prv_bare_compile.erl 查看文件

@ -53,7 +53,11 @@ do(State) ->
{RawOpts, _} = rebar_state:command_parsed_args(State), {RawOpts, _} = rebar_state:command_parsed_args(State),
Paths = proplists:get_value(paths, RawOpts), Paths = proplists:get_value(paths, RawOpts),
Sep = proplists:get_value(separator, RawOpts, " "), Sep = proplists:get_value(separator, RawOpts, " "),
OutDir = proplists:get_value(outdir, RawOpts, rebar_dir:get_cwd()),
%% Because mix won't check for versions, it instead sets this variable
%% that it knows older rebar3 version will ignore so we play nice and
%% honor it.
DefaultOutDir = os:getenv("REBAR_BARE_COMPILER_OUTPUT_DIR", rebar_dir:get_cwd()),
OutDir = proplists:get_value(outdir, RawOpts, DefaultOutDir),
[ code:add_pathsa(filelib:wildcard(PathWildcard)) [ code:add_pathsa(filelib:wildcard(PathWildcard))
|| PathWildcard <- rebar_string:lexemes(Paths, Sep) ], || PathWildcard <- rebar_string:lexemes(Paths, Sep) ],

正在加载...
取消
保存