omoidasu

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

review (440B)


      1 #!/bin/sh
      2 
      3 . ./config
      4 
      5 usage() {
      6 	echo "usage: $0 cards.deck [cards1.deck ...]"
      7 	exit 1
      8 }
      9 
     10 [ $# -lt 1 ] && usage
     11 [ ! -f $1 ] && usage
     12 
     13 fifo=fifo.$$
     14 sync=sync.$$
     15 die() {
     16 	rm -f $fifo $sync
     17 }
     18 trap die EXIT INT TERM
     19 
     20 mkfifo -m 0600 $fifo $sync
     21 
     22 chmod +w "$@"
     23 oboeru $fifo "$@" > $sync &
     24 oboerudata $sync \
     25 | oboeruhttp -p "$PORT" -F "$FAIL" -P "$PASS" -Q "$QUIT" -S "$SHOW" -q "$BYE" \
     26 > $fifo &
     27 
     28 browser "localhost:$PORT"
     29 
     30 wait
     31 chmod -w "$@"