Skip to content

Commit

Permalink
treehouses feedback better output (fixes #2287) (#2288)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Sep 20, 2023
1 parent e551ab2 commit 70e909f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions modules/feedback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ function feedback {
ip_address="invalid address"
fi
message="${message//\`/}"
message="${message// /\\b}"
if [ "$(detectrpi)" != "nonrpi" ]; then
body="{\"content\":\"**$(hostname)**\b$ip_address\b$(version)\b$(detectrpi)\b$(cat /boot/version.txt)\n$message\"}"
body="{\"content\":\"**$(hostname)** $ip_address $(version) $(detectrpi) $(cat /boot/version.txt)\n$message\"}"
else
body="{\"content\":\"**$(hostname)**\b$ip_address\b$(version)\b$(detect | sed "s/ /\\\b/1")\n$message\"}"
body="{\"content\":\"**$(hostname)** $ip_address $(version) $(detect)\n$message\"}"
fi
curl -s -X POST -H "Content-Type:application/json" "$chat$hook" -d $body> "$LOGFILE"
curl -s -X POST -H "Content-Type:application/json" "$chat$hook" -d "$body" > "$LOGFILE"
echo "Thanks for the feedback!"
else
log_and_exit1 "No feedback was submitted."
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.26.12",
"version": "1.26.13",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down

0 comments on commit 70e909f

Please sign in to comment.