Merge pull request #9549 from zmstone/1214-chore-update-erl-shell-prompt

refactor: change ce | ee to v | prefix for shell prompt
This commit is contained in:
Zaiming (Stone) Shi 2022-12-14 14:59:37 +01:00 committed by GitHub
commit d2cc7d3258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -45,10 +45,14 @@ set_prompt_func() ->
prompt_func(PropList) ->
Line = proplists:get_value(history, PropList, 1),
Version = emqx_release:version(),
Edition = emqx_release:edition(),
Prefix =
case emqx_release:edition() of
ce -> "v";
ee -> "e"
end,
case is_alive() of
true -> io_lib:format(<<"~ts-~ts(~s)~w> ">>, [Edition, Version, node(), Line]);
false -> io_lib:format(<<"~ts-~ts ~w> ">>, [Edition, Version, Line])
true -> io_lib:format(<<"~ts~ts(~s)~w> ">>, [Prefix, Version, node(), Line]);
false -> io_lib:format(<<"~ts~ts ~w> ">>, [Prefix, Version, Line])
end.
local_allowed(MF, Args, State) ->