From af56cac5e3906b6f8c32ed57b7b93ab93f155ced Mon Sep 17 00:00:00 2001 From: vilaca Date: Sat, 6 Apr 2024 22:32:38 +0100 Subject: [PATCH] improve layout --- scripts/diffs.sh | 12 +++++++----- scripts/utils/yesterday.sh | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/diffs.sh b/scripts/diffs.sh index a14cf3f..3f41169 100755 --- a/scripts/diffs.sh +++ b/scripts/diffs.sh @@ -13,7 +13,9 @@ do yesterday["$name"]=$position done < "yesterday-nr" -echo "|Current|Yesterday|Repository|Change|" +printf '
\n\n' + +echo "|Current|Yesterday|Repository|Up/Dn|" echo "|:---:|:---:|:---|:---:|" #draw chart while IFS="" read -r line || [ -n "$line" ] @@ -23,17 +25,17 @@ do move="" if ((position < last)) then - move="⬆️" + move="🔼" elif ((position > last)) then - move="⬇️" + move="🔽" else move="-" fi - - echo "|$position|${last:--}|$name|$move|" + echo "|$position|${last:--}|[$name]($name)|$move|" done < "today-nr" +printf '\n\n
\n' diff --git a/scripts/utils/yesterday.sh b/scripts/utils/yesterday.sh index 45128b0..c926d71 100755 --- a/scripts/utils/yesterday.sh +++ b/scripts/utils/yesterday.sh @@ -1,5 +1,5 @@ current_date=$(date +%s) -seven_days=$((7 * 24 * 60 * 60)) -seven_days_ago=$((current_date - seven_days)) -seven_days_ago_date=$(date -d "@$seven_days_ago" +%d-%m-%Y) -echo $seven_days_ago_date \ No newline at end of file +yesterday=$((1 * 24 * 60 * 60)) +yesterday_ago=$((current_date - yesterday)) +yesterday_ago_date=$(date -d "@$yesterday_ago" +%d-%m-%Y) +echo $yesterday_ago_date \ No newline at end of file