From 8aaa3804013ced82c574f13ba0962d707cfa5437 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 7 Apr 2023 04:49:37 +0200 Subject: [PATCH] Updated the json link values. --- README.json | 3 ++- src/today.sh | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.json b/README.json index e6a7522..eb938ae 100644 --- a/README.json +++ b/README.json @@ -21,6 +21,7 @@ "Deut 33:27" ] }, + "joomla": "https://git.vdm.dev/christian/mod_dailylight", "morning": { "body": [ "We ... rejoice in hope of the glory of God. And not only so, but we glory in tribulations also. -- I am filled with comfort, I am exceeding joyful in all our tribulation. -- Believing, ye rejoice with joy unspeakable and full of glory.", @@ -40,5 +41,5 @@ ] }, "source": "https://github.com/trueChristian/daily-light", - "telegram": "https://t.me/s/daily_light" + "telegram": "daily_light" } diff --git a/src/today.sh b/src/today.sh index 9b33fa4..b7e66e3 100755 --- a/src/today.sh +++ b/src/today.sh @@ -13,6 +13,7 @@ command -v git >/dev/null 2>&1 || { #█████████████████████████████████████████████████████████████████ GLOBALS ███ # global config options DRY_RUN=0 +DO_GIT=1 # the date TODAY=$(TZ="Africa/Windhoek" date '+%B-%d') TODAY_DATE=$(TZ="Africa/Windhoek" date '+%A %d-%B, %Y') @@ -24,6 +25,9 @@ while :; do --dry) DRY_RUN=1 ;; + --git-off) + DO_GIT=0 + ;; -t | --today) # Takes an option argument; ensure it has been specified. if [ "$2" ]; then TODAY=$2 @@ -181,15 +185,17 @@ JSON="$( --arg date_key "$DATE_KEY" \ --argjson morning "$MORNING_JSON" \ --argjson evening "$EVENING_JSON" \ - --arg telegram "https://t.me/s/daily_light" \ - --arg source "https://github.com/trueChristian/daily-light" ' + --arg telegram "daily_light" \ + --arg source "https://github.com/trueChristian/daily-light" \ + --arg joomla "https://git.vdm.dev/christian/mod_dailylight" ' { date_name: $date_name, date_key: $date_key, morning: $morning, evening: $evening, telegram: $telegram, - source: $source + source: $source, + joomla: $joomla } ' )" @@ -233,14 +239,18 @@ else #██████████████████████████████████████████████████████████████ SET README ███ - echo "${README}" > README.md + echo "${README}" > README.md #████████████████████████████████████████████████████████████████ SET JSON ███ - jq <<<"$JSON" -S . >README.json + jq <<<"$JSON" -S . >README.json - git commit -am"${TODAY_DATE}" - git push + #██████████████████████████████████████████████████████████████ UPDATE GIT ███ + if (("$DO_GIT" == 1)); then + git add . + git commit -am"${TODAY_DATE}" + git push + fi fi exit 0