Skip to content

Commit

Permalink
Change how some stuff is printed
Browse files Browse the repository at this point in the history
  • Loading branch information
CaspianA1 committed Jun 15, 2024
1 parent 18238fc commit 4f27ed4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/trigger_surprise.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@

# Script param: surprise name.

log() {
echo ">>> $1"
}

fail() {
echo "$1"
log "$1"
exit 1
}

path="$1"

echo "Note: if the dashboard is not in focus, this script may hang until it becomes so."
log "Note: if the dashboard is not in focus, this script may hang until it becomes so."

if [[ "$path" == "" ]]; then
fail "Please provide a surprise path (in the format of \"assets/<surprise_name>\")!"
fi

printf "$path" | nc -U /tmp/surprises_wbor_studio_dashboard.sock || fail "Could not send the path to the dashboard's socket!"

echo ">>> Sent the surprise to the dashboard. Check the dashboard logs to see that the surprise was received."
log "Sent the surprise to the dashboard. Check the dashboard logs to see that the surprise was received."

0 comments on commit 4f27ed4

Please sign in to comment.