Browse Source

fix(config): configs in emqx_machine.conf was merged twice into emqx.conf

Shawn 4 years atrás
parent
commit
c0447d58b4
1 changed files with 3 additions and 4 deletions
  1. 3 4
      scripts/merge-config.escript

+ 3 - 4
scripts/merge-config.escript

@@ -11,9 +11,8 @@
 -mode(compile).
 
 main(_) ->
-    BaseConf = "apps/emqx_machine/etc/emqx_machine.conf",
-    {ok, Bin} = file:read_file(BaseConf),
-    Apps = filelib:wildcard("*", "apps/"),
+    {ok, BaseConf} = file:read_file("apps/emqx_machine/etc/emqx_machine.conf"),
+    Apps = filelib:wildcard("*", "apps/") -- ["emqx_machine"],
     Conf = lists:foldl(fun(App, Acc) ->
         Filename = filename:join([apps, App, "etc", App]) ++ ".conf",
         case filelib:is_regular(Filename) of
@@ -22,5 +21,5 @@ main(_) ->
                 [Acc, io_lib:nl(), Bin1];
             false -> Acc
         end
-    end, Bin, Apps),
+    end, BaseConf, Apps),
     ok = file:write_file("apps/emqx_machine/etc/emqx.conf.all", Conf).