Преглед изворни кода

Merge pull request #5533 from terry-xiaoyu/merge_config_twice

fix(config): configs in emqx_machine.conf was merged twice into emqx.conf
Zaiming (Stone) Shi пре 4 година
родитељ
комит
a67f2869a3
1 измењених фајлова са 3 додато и 4 уклоњено
  1. 3 4
      scripts/merge-config.escript

+ 3 - 4
scripts/merge-config.escript

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