Merge pull request #10263 from paulozulato/feat-eval-ex
feat: add new command for Elixir expression evaluation
This commit is contained in:
commit
03a70bb527
25
bin/emqx
25
bin/emqx
|
@ -164,6 +164,9 @@ usage() {
|
|||
eval-erl)
|
||||
echo "Evaluate an Erlang expression in the EMQX node, even on Elixir node"
|
||||
;;
|
||||
eval-ex)
|
||||
echo "Evaluate an Elixir expression in the EMQX node. Only applies to Elixir node"
|
||||
;;
|
||||
versions)
|
||||
echo "List installed EMQX release versions and their status"
|
||||
;;
|
||||
|
@ -228,7 +231,7 @@ usage() {
|
|||
echo " Install Info: ertspath | root_dir"
|
||||
echo " Runtime Status: pid | ping"
|
||||
echo " Validate Config: check_config"
|
||||
echo " Advanced: console_clean | escript | rpc | rpcterms | eval | eval-erl"
|
||||
echo " Advanced: console_clean | escript | rpc | rpcterms | eval | eval-erl | eval-ex"
|
||||
echo ''
|
||||
echo "Execute '$REL_NAME COMMAND help' for more information"
|
||||
;;
|
||||
|
@ -1280,7 +1283,27 @@ case "${COMMAND}" in
|
|||
shift
|
||||
relx_nodetool "eval" "$@"
|
||||
;;
|
||||
eval-ex)
|
||||
assert_node_alive
|
||||
|
||||
shift
|
||||
if [ "$IS_ELIXIR" = "yes" ]
|
||||
then
|
||||
"$REL_DIR/elixir" \
|
||||
--hidden \
|
||||
--name "rand-$(relx_gen_id)-$NAME" \
|
||||
--cookie "$COOKIE" \
|
||||
--boot "$REL_DIR/start_clean" \
|
||||
--boot-var RELEASE_LIB "$ERTS_LIB_DIR" \
|
||||
--vm-args "$REL_DIR/remote.vm.args" \
|
||||
--erl "-start_epmd false -epmd_module ekka_epmd" \
|
||||
--rpc-eval "$NAME" "$@"
|
||||
else
|
||||
echo "EMQX node is not an Elixir node"
|
||||
usage "$COMMAND"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
check_config)
|
||||
check_config
|
||||
;;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Add command 'eval-ex' for Elixir expression evaluation.
|
Loading…
Reference in New Issue