zio
/
webhookd-scripts
Archived
2
0
Fork 0

v1: modify fallback ping message

main
Ducky 2022-01-05 11:22:49 +00:00
parent 82076cfd88
commit 4bd19c7fc2
1 changed files with 10 additions and 7 deletions

17
v1.sh
View File

@ -65,6 +65,11 @@ function write_log() {
echo "[$(now)] $@" echo "[$(now)] $@"
} }
function write_separator() {
char=$1
echo "$(printf "%0.s$char" {1..80})"
}
payload=$1 payload=$1
service=$2 service=$2
event=$3 event=$3
@ -174,9 +179,9 @@ if [[ ! -z $script_path ]]; then
write_log "Executing script..." write_log "Executing script..."
echo "================================================================================" write_separator "="
$script_path $script_path
echo "================================================================================" write_separator "="
write_log "Removing working directory..." write_log "Removing working directory..."
rm -rf $build_path rm -rf $build_path
@ -196,11 +201,9 @@ if [[ ! -z $script_path ]]; then
echo " Started: $started_time" echo " Started: $started_time"
else else
if [[ $event == "ping" ]]; then if [[ $event == "ping" ]]; then
if [[ $(command -v figlet &> /dev/null) ]]; then echo "Pong!"
figlet "Pong!" echo ""
else echo "If you're seeing this, that means you've done something right. To trigger scripts on events place them in '$script_base_dir/$service/$repo_author/$repo_name/<event>.sh'."
echo "Pong!"
fi
else else
die "No handler for $event on $service:$repo" die "No handler for $event on $service:$repo"
fi fi