refactor: move version prefix string detection to a static fun
this is to make dialyzer happy
This commit is contained in:
parent
62d3943fc1
commit
cac7e0c5f0
|
@ -18,6 +18,7 @@
|
|||
|
||||
-export([
|
||||
edition/0,
|
||||
edition_vsn_prefix/0,
|
||||
edition_longstr/0,
|
||||
description/0,
|
||||
version/0
|
||||
|
@ -45,11 +46,11 @@ description() ->
|
|||
-spec edition() -> ce | ee.
|
||||
-ifdef(EMQX_RELEASE_EDITION).
|
||||
edition() -> ?EMQX_RELEASE_EDITION.
|
||||
|
||||
edition_vsn_prefix() -> "e".
|
||||
edition_longstr() -> <<"Enterprise">>.
|
||||
-else.
|
||||
edition() -> ce.
|
||||
|
||||
edition_vsn_prefix() -> "v".
|
||||
edition_longstr() -> <<"Opensource">>.
|
||||
-endif.
|
||||
|
||||
|
|
|
@ -45,11 +45,7 @@ set_prompt_func() ->
|
|||
prompt_func(PropList) ->
|
||||
Line = proplists:get_value(history, PropList, 1),
|
||||
Version = emqx_release:version(),
|
||||
Prefix =
|
||||
case emqx_release:edition() of
|
||||
ce -> "v";
|
||||
ee -> "e"
|
||||
end,
|
||||
Prefix = emqx_release:edition_vsn_prefix(),
|
||||
case is_alive() of
|
||||
true -> io_lib:format(<<"~ts~ts(~s)~w> ">>, [Prefix, Version, node(), Line]);
|
||||
false -> io_lib:format(<<"~ts~ts ~w> ">>, [Prefix, Version, Line])
|
||||
|
|
Loading…
Reference in New Issue