Browse Source

{bert,js} initialization during compile time

Namdak Tonpa 6 years ago
parent
commit
b2bd86bb27
3 changed files with 5 additions and 1 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 4 0
      src/compile/mad_compile.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"b02456").
+-define(VERSION,"6b5447").

BIN
mad


+ 4 - 0
src/compile/mad_compile.erl

@@ -3,6 +3,10 @@
 -compile(export_all).
 
 compile(Params) ->
+    SysConfig = try {ok,[S]} = file:consult("sys.config"), S catch _:_ -> [] end,
+    BERT = proplists:get_value(bert,SysConfig,[]),
+    JS = proplists:get_value(js,BERT,[]),
+    application:set_env(bert,js,JS),
     case mad_utils:configs() of
          {error,E} -> {error,E};
          {ok,{ Cwd, ConfigFile, Conf }} ->