Skip to content

Commit

Permalink
feat: Multiline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaironalves committed Jul 12, 2024
1 parent 5d5cf71 commit e9daa48
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e9daa48

Please sign in to comment.