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
print_course(){
local coursefile="$1"
local course="$(pdi_load "$coursefile")"
+
cat <<-EOF
[div .course #${coursefile##*/}
[div .section .basic . $(
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