mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
c484847adf
* added commands to reload script
* catch errors with git pull
* read new webhook from os variable
* correcting bash
* bash fixes
* formatting
* more robust error checking
* only sends success if git changes
* catching error from script
* escaping error text to send with curl
* correct text escaping for error message
Former-commit-id: c95f88075b
11 lines
347 B
Bash
11 lines
347 B
Bash
#!/bin/sh
|
|
. /home/ubuntu/.bashrc
|
|
export PATH="/usr/local/bin:/usr/bin:/bin"
|
|
|
|
ERROR=$(sh ./reload_website.sh 2>&1)
|
|
|
|
if ! [ $? -eq 0 ]; then
|
|
data=$( jo text="$(echo "gradio.app is not tracking master :o: \nError:\n\n\`\`\`'$ERROR'\`\`\`")")
|
|
echo "$data"
|
|
curl -X POST -H 'Content-type: application/json' --data "$data" ${SLACK_WEBHOOK}
|
|
fi |