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([
|
-export([
|
||||||
edition/0,
|
edition/0,
|
||||||
|
edition_vsn_prefix/0,
|
||||||
edition_longstr/0,
|
edition_longstr/0,
|
||||||
description/0,
|
description/0,
|
||||||
version/0
|
version/0
|
||||||
|
@ -45,11 +46,11 @@ description() ->
|
||||||
-spec edition() -> ce | ee.
|
-spec edition() -> ce | ee.
|
||||||
-ifdef(EMQX_RELEASE_EDITION).
|
-ifdef(EMQX_RELEASE_EDITION).
|
||||||
edition() -> ?EMQX_RELEASE_EDITION.
|
edition() -> ?EMQX_RELEASE_EDITION.
|
||||||
|
edition_vsn_prefix() -> "e".
|
||||||
edition_longstr() -> <<"Enterprise">>.
|
edition_longstr() -> <<"Enterprise">>.
|
||||||
-else.
|
-else.
|
||||||
edition() -> ce.
|
edition() -> ce.
|
||||||
|
edition_vsn_prefix() -> "v".
|
||||||
edition_longstr() -> <<"Opensource">>.
|
edition_longstr() -> <<"Opensource">>.
|
||||||
-endif.
|
-endif.
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,7 @@ set_prompt_func() ->
|
||||||
prompt_func(PropList) ->
|
prompt_func(PropList) ->
|
||||||
Line = proplists:get_value(history, PropList, 1),
|
Line = proplists:get_value(history, PropList, 1),
|
||||||
Version = emqx_release:version(),
|
Version = emqx_release:version(),
|
||||||
Prefix =
|
Prefix = emqx_release:edition_vsn_prefix(),
|
||||||
case emqx_release:edition() of
|
|
||||||
ce -> "v";
|
|
||||||
ee -> "e"
|
|
||||||
end,
|
|
||||||
case is_alive() of
|
case is_alive() of
|
||||||
true -> io_lib:format(<<"~ts~ts(~s)~w> ">>, [Prefix, Version, node(), Line]);
|
true -> io_lib:format(<<"~ts~ts(~s)~w> ">>, [Prefix, Version, node(), Line]);
|
||||||
false -> io_lib:format(<<"~ts~ts ~w> ">>, [Prefix, Version, Line])
|
false -> io_lib:format(<<"~ts~ts ~w> ">>, [Prefix, Version, Line])
|
||||||
|
|
Loading…
Reference in New Issue