From efc3ea0ce4c4d8efbe95d138e18c266ee2547975 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 15 Apr 2024 13:05:08 +0200 Subject: [PATCH] omit listing of empty courses and vcards --- cards/list.sh | 4 +--- courses/list.sh | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cards/list.sh b/cards/list.sh index a7b8c13..6e78def 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -113,11 +113,9 @@ print_cards(){ while read cardfile; do cachefile="${_DATA}/cache/${cardfile##*/}.cache" - # if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" \ - # -a "$cachefile" -nt "${_EXEC}/cards" ]; then if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" ]; then cat "$cachefile" - else + elif [ -s "$cardfile" ]; then print_card "$cardfile" |tee "$cachefile" fi done diff --git a/courses/list.sh b/courses/list.sh index 7152266..95857ec 100755 --- a/courses/list.sh +++ b/courses/list.sh @@ -53,6 +53,7 @@ edit_course(){ print_course(){ local coursefile="$1" local course="$(pdi_load "$coursefile")" + cat <<-EOF [div .course #${coursefile##*/} [div .section .basic . $( @@ -94,7 +95,7 @@ print_courses(){ cachefile="${_DATA}/cache/${calfile##*/}.cache" if [ -s "$cachefile" -a "$cachefile" -nt "$calfile" ]; then cat "$cachefile" - else + elif [ -s "$calfile" ]; then print_course "$calfile" |tee "$cachefile" fi done -- 2.39.2