From a79c741ee5e12d578e1a1f04a5a1b79614fba4ac Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 25 Apr 2023 18:02:10 +0200 Subject: [PATCH] build: fix docdir --- rebar.config.erl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rebar.config.erl b/rebar.config.erl index 3c863046f..dc445db54 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -509,7 +509,7 @@ etc_overlay(ReleaseType, Edition) -> [ {mkdir, "etc/"}, {copy, "{{base_dir}}/lib/emqx/etc/certs", "etc/"}, - {copy, "_build/docgen/" ++ name(Edition) ++ "/emqx.conf.example", "etc/emqx.conf.example"} + {copy, "_build/docgen/" ++ profile() ++ "/emqx.conf.example", "etc/emqx.conf.example"} ] ++ lists:map( fun @@ -646,5 +646,15 @@ list_dir(Dir) -> [] end. -name(ce) -> "emqx"; -name(ee) -> "emqx-enterprise". +profile() -> + case os:getenv("PROFILE") of + Profile = "emqx-enterprise" ++ _ -> + Profile; + Profile = "emqx" ++ _ -> + Profile; + false -> + "emqx-enterprise"; + Profile -> + io:format(standard_error, "ERROR: bad_PROFILE ~p~n", [Profile]), + exit(bad_PROFILE) + end.