diff --git a/entrypoint.sh b/entrypoint.sh index f9cf2d9..5735c11 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -33,27 +33,28 @@ _yaml_keys_names_outputs_values_rename() { echo "$keysNamesOutputsValues" | while read -r keyNameOutputValueLine; do keyNameOutputSearch="${keyNameOutputValueLine%%=*}" - keyNameOutputValue="${keyNameOutputValueLine#*=}" keyNameOutputRenameValue=$(_yaml_keys_names_outputs_values_rename_value "$keyNameOutputSearch" "$keysNamesOutputsRename") - keyNameOutput=${keyNameOutputRenameValue:-$keyNameOutputSearch} - echo "$keyNameOutput=$keyNameOutputValue" + if [ -n "$keyNameOutputRenameValue" ]; then + keyNameOutputValue="${keyNameOutputValueLine#*=}" + echo "$keyNameOutputRenameValue=$keyNameOutputValue" + else + echo "$keyNameOutputValueLine" + fi done } -_yaml_keys_names_outputs_values_rename() { - local keysNamesOutputsValues="$1" +_yaml_keys_names_outputs_values_rename_value() { + local keyNameOutputSearch="$1" local keysNamesOutputsRename="$2" - echo "$keysNamesOutputsValues" | while read -r keyNameOutputValueLine; do - keyNameOutputSearch="${keyNameOutputValueLine%%=*}" + echo "$keysNamesOutputsRename" | while read -r keyNameOutputRenameLine; do + keyNameOutputRename="${keyNameOutputRenameLine%%=*}" - keyNameOutputRenameValue=$(_yaml_keys_names_outputs_values_rename_value "$keyNameOutputSearch" "$keysNamesOutputsRename") - if [ -n "$keyNameOutputRenameValue" ]; then - keyNameOutputValue="${keyNameOutputValueLine#*=}" - echo "$keyNameOutputRenameValue=$keyNameOutputValue" - else - echo "$keyNameOutputValueLine" + if [ "$keyNameOutputRename" = "$keyNameOutputSearch" ]; then + keyNameOutputRenameValue="${keyNameOutputRenameLine#*=}" + echo "$keyNameOutputRenameValue" + break fi done }