Browse Source

More complex metadata output

master
Drew Short 5 years ago
parent
commit
1745ddfbe5
  1. 8
      assets/out

8
assets/out

@ -129,24 +129,24 @@ if (( ${#file_links[@]} )); then
echo "File Links:" "${file_links[@]}"
# shellcheck disable=2068
metadata=$(printf '{"name": "%s", "value": "%s"},' ${file_links[@]})
metadata=${metadata::-1}
metadata="[${metadata::-1}]"
links_json=$( echo -n "{\"links\":[${metadata}]}" | jq -r . )
echo "$links_json" > "${TMPDIR}/.rclone_links"
cat "${TMPDIR}/.rclone_links"
jq -n "{
version: {
build: $( echo -n "${BUILD_ID}" | jq -R .),
digest: $( echo -n "sha256:$sha256" | jq -R . )
digest: $( echo -n "sha256:${sha256}" | jq -R . )
},
metadata: [
{name: \"links\", value: $( echo -n "${file_links[@]}" | jq -R . )}
${metadata}
]
}" >&3
else
jq -n "{
version: {
build: $( echo -n "${BUILD_ID}" | jq -R .),
digest: $( echo -n "sha256:$sha256" | jq -R . )
digest: $( echo -n "sha256:${sha256}" | jq -R . )
}
}" >&3
fi
Loading…
Cancel
Save