fix(config): configs in emqx_machine.conf was merged twice into emqx.conf
This commit is contained in:
parent
f3efc89192
commit
c0447d58b4
|
@ -11,9 +11,8 @@
|
||||||
-mode(compile).
|
-mode(compile).
|
||||||
|
|
||||||
main(_) ->
|
main(_) ->
|
||||||
BaseConf = "apps/emqx_machine/etc/emqx_machine.conf",
|
{ok, BaseConf} = file:read_file("apps/emqx_machine/etc/emqx_machine.conf"),
|
||||||
{ok, Bin} = file:read_file(BaseConf),
|
Apps = filelib:wildcard("*", "apps/") -- ["emqx_machine"],
|
||||||
Apps = filelib:wildcard("*", "apps/"),
|
|
||||||
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).
|
||||||
|
|
Loading…
Reference in New Issue