Skip to content

Commit

Permalink
Fix default values
Browse files Browse the repository at this point in the history
  • Loading branch information
bgandon committed Feb 5, 2024
1 parent 29b90fa commit 25679ce
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions out
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ icon_url=$( jq --raw-output '.params.icon_url // empty' <<<
icon_emoji=$(jq --raw-output '.params.icon_emoji // empty' <<< "${payload}")
link_names=$(jq --raw-output '.params.link_names // false' <<< "${payload}")

channels=$( jq --raw-output '.params.channel // null' <<< "${payload}")
channel_file=$( jq --raw-output '.params.channel_file // null' <<< "${payload}")
channels=$( jq --raw-output '.params.channel // empty' <<< "${payload}")
channel_file=$( jq --raw-output '.params.channel_file // empty' <<< "${payload}")
attachments_file=$(jq --raw-output '.params.attachments_file // empty' <<< "${payload}")
attachments=$( jq --raw-output '.params.attachments // null' <<< "${payload}")
attachments=$( jq --raw-output '.params.attachments // empty' <<< "${payload}")

debug=$( jq --raw-output '.params.debug // false' <<< "${payload}")
show_metadata=$(jq --raw-output '.params.metadata // false' <<< "${payload}")
Expand Down Expand Up @@ -83,7 +83,7 @@ ATTACHMENTS_FILE_CONTENT=""
if [[ -n "${attachments_file}" && -f "${attachments_file}" ]]; then
ATTACHMENTS_FILE_CONTENT=$(< "${attachments_file}")
fi
if [[ "${attachments}" == "null" && -n "${ATTACHMENTS_FILE_CONTENT}" ]]; then
if [[ -z "${attachments}" && -n "${ATTACHMENTS_FILE_CONTENT}" ]]; then
attachments="${ATTACHMENTS_FILE_CONTENT}"
fi

Expand Down Expand Up @@ -135,21 +135,21 @@ for channel in ${channels}; do

body=$(
jq --null-input \
--arg "text_interpolated" "${text_interpolated}" \
--arg "username" "${username}" \
--arg "link_names" "${link_names}" \
--arg "text_interpolated" "${text_interpolated}" \
--arg "username" "${username}" \
--argjson "link_names" "${link_names}" \
--arg "icon_url" "${icon_url}" \
--arg "icon_emoji" "${icon_emoji}" \
--arg "channel" "${channel}" \
--arg "attachments" "${attachments}" \
'{
text: $text_interpolated,
username: $username,
username: $username // null,
link_names: $link_names,
icon_url: $icon_url,
icon_emoji: $icon_emoji,
channel: $channel,
attachments: $attachments
icon_url: $icon_url // null,
icon_emoji: $icon_emoji // null,
channel: $channel // null,
attachments: $attachments // null
}'
)

Expand Down

0 comments on commit 25679ce

Please sign in to comment.