summaryrefslogtreecommitdiff
path: root/.travis/webhook.sh
blob: e50f3c292b4a7e8e4d47ccc60247f9e9dce36649 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
set -e

root="$(readlink -e "$(dirname "$0")/..")"

# Report unnamed symbols
content="$("$root/tools/unnamed.py" -r "$root" "$root/pokered.sym" | head)"

curl -H 'Content-Type: application/json' -X POST "$POKERED_DISCORD_WEBHOOK_URL" -d@- << EOF
{
    "username": "$POKERED_DISCORD_WEBHOOK_USERNAME",
    "avatar_url": "$POKERED_DISCORD_WEBHOOK_AVATAR_URL",
    "content": "\`\`\`$(echo "$content" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')\`\`\`"
}
EOF