From e32d6b2c56116899ce3c1fed180bd684ab852304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kydl=C3=AD=C4=8Dek?= Date: Fri, 26 Apr 2024 14:22:34 +0200 Subject: [PATCH] Added newlines between each meal --- zradylko.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/zradylko.sh b/zradylko.sh index 0f5ea3e..d83d049 100755 --- a/zradylko.sh +++ b/zradylko.sh @@ -43,15 +43,18 @@ get_zradylko() { ;; esac + main_course_with_newlines=$(echo "$main_course" | sed 's/ Kč/ Kč\\n/g') + weekly_course_with_newlines=$(echo "$main_course" | sed 's/ Kč/ Kč\\n/g') + # Create a JSON object with the desired fields # shellcheck disable=SC2016 output=''${output}' { "title": "**'"$commonName"'**", "author": { - "name": "'"$restaurant_name"'", - "icon_url": "'"${icon}"'" - }, + "name": "'"$restaurant_name"'", + "icon_url": "'"${icon}"'" + }, "fields": [ { "name": "Polevka", @@ -59,11 +62,11 @@ get_zradylko() { }, { "name": "Hlavni chod", - "value": "'"$main_course"'" + "value": "'"$main_course_with_newlines"'" }, { "name": "Tydenni nabidka", - "value": "'"$weekly_course"'" + "value": "'"$weekly_course_with_newlines"'" } ] },' @@ -80,9 +83,9 @@ get_habibi() { { "title": "**'"$commonName"'**", "author": { - "name": "'"$commonName"'", - "icon_url": "'"${icon}"'" - }, + "name": "'"$commonName"'", + "icon_url": "'"${icon}"'" + }, "fields": [ { "name": "Menu",