]> git.plutz.net Git - confetti/commitdiff
omit listing of empty courses and vcards
authorPaul Hänsch <paul@plutz.net>
Mon, 15 Apr 2024 11:05:08 +0000 (13:05 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 15 Apr 2024 11:05:08 +0000 (13:05 +0200)
cards/list.sh
courses/list.sh

index a7b8c13671dadc3d823d87368619a5ae9e08ec21..6e78def7ae2856ee915bcdbcdb67d02cb3b7ee1b 100755 (executable)
@@ -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
index 71522667640a8d57a24824782f2e61544ceee891..95857ec06f8293e39b4ecfa79ff38da6469a215f 100755 (executable)
@@ -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