omoidasu

a flashcard review system built on oboeru
git clone anongit@rnpnr.xyz:omoidasu.git
Log | Files | Refs | Feed | README | LICENSE

Commit: ba7c3bb94e0a23d983f20f1a50500105d0650a5c
Parent: 75516a3e1fad3fef81577730736e5956d694da6f
Author: Randy Palamar
Date:   Fri,  4 Mar 2022 19:39:49 -0700

deck2data: relagate line splitting to shell builtins

this removes a few more external programs from inside the loop

here is the average time save from running
	time deck2data deck.deck >/dev/null
5 times in a loop on a ~3900 card deck

before:
    0m06.44s real     0m07.78s user     0m01.60s system
after:
    0m05.59s real     0m07.13s user     0m01.42s system

Diffstat:
Mdeck2data | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/deck2data b/deck2data @@ -13,10 +13,13 @@ usage() { [ $# -eq 1 ] || usage -deck=$(echo "$1" | cut -d '.' -f 1) +# remove extension +deck=${1%.*} -while read line; do - id=$(echo "$line" | cut -d $DELIM -f 1) +# hack to expand DELIM +IFS=$(printf $DELIM) + +while read id _; do path="$deck"/"$id" front=$(smu "$path"/front.md | tr -d '\n' | sed 's;src="\([^"]*\)";src="/_/'$path'/\1";g')