From 522c4f52f511d7f2dc4a9166a5dbbeb282e5c8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 23 Oct 2017 21:50:40 +0100 Subject: Add CONFIG and SCRIPT variables to .app.src.script files Ew rebar, geez! --- core/deps.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3