diff options
author | Loïc Hoguin <[email protected]> | 2017-10-23 21:50:40 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-10-23 21:50:56 +0100 |
commit | 522c4f52f511d7f2dc4a9166a5dbbeb282e5c8fa (patch) | |
tree | be0d7e6f3825d6c882c7075640dba3f4a1e36e36 /core | |
parent | c0f3338fa3afd0b8c9ae8033a4e8c71dfdb9bdbd (diff) | |
download | erlang.mk-522c4f52f511d7f2dc4a9166a5dbbeb282e5c8fa.tar.gz erlang.mk-522c4f52f511d7f2dc4a9166a5dbbeb282e5c8fa.tar.bz2 erlang.mk-522c4f52f511d7f2dc4a9166a5dbbeb282e5c8fa.zip |
Add CONFIG and SCRIPT variables to .app.src.script files
Ew rebar, geez!
Diffstat (limited to 'core')
-rw-r--r-- | core/deps.mk | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/deps.mk b/core/deps.mk index 9cec5a1..58466a6 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -476,7 +476,10 @@ endef define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", - Bindings = erl_eval:new_bindings(), + {ok, Conf0} = file:consult(AppSrc), + Bindings0 = erl_eval:new_bindings(), + Bindings1 = erl_eval:add_binding('CONFIG', Conf0, Bindings0), + Bindings = erl_eval:add_binding('SCRIPT', AppSrcScript, Bindings1), {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() |