concourse-apprise-notifier/in

20 lines
329 B
Text
Raw Normal View History

2023-05-26 18:04:49 +00:00
#!/bin/sh
2023-05-26 21:20:20 +00:00
set -e
exec 3>&1 # make stdout available as fd 3 for the result
exec 1>&2 # redirect all output to stderr for logging
PAYLOAD=$(mktemp /tmp/resource-in.XXXXXX)
cat > "$PAYLOAD" <&0
TS=$(jq '.version.timestamp // empty' < "$PAYLOAD")
[ -z "$TS" ] && TS='"none"'
jq -n "{
version: {
timestamp: $TS
}
}" >&3