fix(bin/emqx): make sed replace \n work in macos 10

This commit is contained in:
Zaiming (Stone) Shi 2022-04-23 13:27:02 +02:00
parent 7ee1d6d54d
commit 5d8539c01a
1 changed files with 4 additions and 1 deletions

View File

@ -356,7 +356,10 @@ generate_config() {
## transform a single line args list like '-config ... -args_file ... -vm_args ...' to lines and get path for each file respectively
## NOTE: the -args_file and -vm_args are the same file passed twice because args_file is used by beam, but not possible to get at runtime
## by calling init:get_arguments/0
lines="$(echo "$CUTTLEFISH_OUTPUT" | tail -1 | sed 's/-config/\nconfig=/g' | sed 's/-args_file/\nargs_file=/g' | sed 's/-vm_args/\nvm_args=/g')"
lines="$(echo "$CUTTLEFISH_OUTPUT" | tail -1 \
| sed -e $'s/-config/\\\nconfig=/g' \
| sed -e $'s/-args_file/\\\nargs_file=/g' \
| sed -e $'s/-vm_args/\\\nvm_args=/g')"
CONFIG_FILE="$(trim "$(echo -e "$lines" | grep 'config=' | sed 's/config=//g')")"
CUTTLE_GEN_ARG_FILE="$(trim "$(echo -e "$lines" | grep 'vm_args=' | sed 's/vm_args=//g')")"